Other action when version changes (instead of page refresh)
See original GitHub issueI’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:
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:
- Created 3 years ago
- Reactions:5
- Comments:8 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Haha, yup, totally! Guilty! ✋
Wow, great! Sometimes we are looking too far and there are much simpler solutions 😅 Thank you!