'Is there a way to detect when Blazor forces you to manually Reload the app?
Is there a way in Blazor to detect when Blazor forces you to manually Reload the page?
I would like to differentiate between that and the user actively entering a page for the first time. For example, lets say a user comes to a page in my Blazor app and leaves the device with the page open, coming back hours later. The user will then normally be presented by Blazor with a message to Reload the page. Can I detect that? I would like to send them to a different page if that happens.
Or, if not possible, how would you solve the problem of a user staying on a page for much longer than "normal"?
My app is a Blazor server side app built with .Net 6.
Edit 1
The app in question is this Wordle inspired app. Once you finish guessing the quote you end up on the /Finished page (example finished page. Given that the app only has one quote a day it is easy to leave the /Finished page open. If you do that and come back the next day and manually Reload the page you will unfortunately see the solution to a quote you haven't guessed yet.
As @Yogi mentions in the top comment below this is controlled by the weg server. I did not know that, but it makes sense. The server is the cheapest version that Microsoft offers in their Azure environment, a shared environment (this is a hobby project after all).
Once the server then (?) has timed out this happens:
On the last screen shot the user can click Reload. Is there a way to identify that this has happened?
Solution 1:[1]
It's the default functionality of the Blazor server. then after if you need to change anything on that you need to change it in blazor.server.js file.
Please check the below image.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Akash Limbani |


