question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Other action when version changes (instead of page refresh)

See original GitHub issue

I’m working on a big app with Inertia. When the version of the js files change, I don’t want a hard refresh, as I find it rather disturbing to the user, and it could lead to loss of data. I wish there was a way to intercept when the version changes so I can do something else instead, for example show a notification like this:

new-version-available

Possible implementation:

import { Inertia } from '@inertiajs/inertia'

Inertia.onVersionChange(function () {
    // Show notification that new version is available
    return false
})

The return false could indicate that Inertia doesn’t have to do a hard refresh, but carry on as if there was no version change.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
reininkcommented, Sep 17, 2020

Haha, yup, totally! Guilty! ✋

1reaction
klaasgeldofcommented, Sep 17, 2020

Wow, great! Sometimes we are looking too far and there are much simpler solutions 😅 Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Identifying Between Refresh And Close Browser Actions
There is a solution. I wanted to disconnect the user on the server when the tab or browser window was closed, but not...
Read more >
Refresh the Page in JavaScript – JS Reload Window Tutorial
When the page refreshes or reloads, it will show any new data ... change based on user actions, you'll want that page to...
Read more >
Local Variables - Appian 22.4
Variables that depend on a specific field within another variable (for example, local variables, rule inputs, etc.) will only refresh when that field...
Read more >
location.reload() - Web APIs | MDN
The location.reload() method reloads the current URL, like the Refresh button.
Read more >
How to Prevent Tags from Firing After a Page Reload w GTM
This is a guide on how to prevent tags from firing after a page reload event. Learn how to detect a page reload...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found