Skip to content

Commit 4757f73

Browse files
committed
frontend/utils: check time elapsed since lastAlive on app reload.
This ensures the app wasnt stopped in the background before appSleeps was set. fix #145
1 parent f2435d1 commit 4757f73

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

frontend/src/utils.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ if (debug) {
147147
}
148148

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

0 commit comments

Comments
 (0)