Skip to content

Commit

Permalink
frontend/utils: check time elapsed since lastAlive on app reload.
Browse files Browse the repository at this point in the history
This ensures the app wasnt stopped in the background before appSleeps was set. fix #145
  • Loading branch information
ffreddow committed Mar 6, 2025
1 parent f2435d1 commit 4757f73
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ if (debug) {
}

window.addEventListener("appReload", () => {
if (appSleeps) {
// Sometime the appSleeps value seems not beeing set. To encounter this check if the lastAlive was
// set during the timout of the wireguard connection
if (appSleeps || Date.now() - lastAlive >= 1000 * 60 * 2) {
window.location.reload();
}
});
Expand Down

0 comments on commit 4757f73

Please sign in to comment.