try to nice unload on phones

This commit is contained in:
Klemek
2024-10-18 18:51:49 +02:00
parent b25828f961
commit 2cd9310974
+2 -1
View File
@@ -183,11 +183,12 @@ let app = {
const self = this;
setTimeout(this.showApp);
this.loadSounds();
document.addEventListener("visibilitychange", function () {
document.addEventListener("visibilitychange", () => {
if (!document.hidden) {
self.onFocus();
}
});
document.addEventListener("beforeunload", self.onFocus);
},
};