Skip to content

Commit abd7bc2

Browse files
feat: add pageshow and focus listeners for reliable update check on app resume
1 parent 8a7cade commit abd7bc2

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

index.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5822,12 +5822,22 @@
58225822
if (document.hidden) {
58235823
clearTimeout(_pollTimer);
58245824
} else {
5825-
// Sofort einen Check anstoßen (mit minimalem Delay damit das DOM settled ist)
58265825
clearTimeout(_pollTimer);
58275826
_pollTimer = setTimeout(_checkForUpdate, 0);
58285827
}
58295828
});
58305829

5830+
// Zusätzliche Trigger für Android-WebView, wo visibilitychange nicht immer feuert.
5831+
window.addEventListener('pageshow', function () {
5832+
clearTimeout(_pollTimer);
5833+
_pollTimer = setTimeout(_checkForUpdate, 0);
5834+
});
5835+
5836+
window.addEventListener('focus', function () {
5837+
clearTimeout(_pollTimer);
5838+
_pollTimer = setTimeout(_checkForUpdate, 0);
5839+
});
5840+
58315841
// Erster Poll startet nach kurzem Delay, damit die App vollständig initialisiert ist.
58325842
_pollTimer = setTimeout(_checkForUpdate, 0);
58335843

0 commit comments

Comments
 (0)