try to nice unload on phones
This commit is contained in:
@@ -183,11 +183,12 @@ let app = {
|
|||||||
const self = this;
|
const self = this;
|
||||||
setTimeout(this.showApp);
|
setTimeout(this.showApp);
|
||||||
this.loadSounds();
|
this.loadSounds();
|
||||||
document.addEventListener("visibilitychange", function () {
|
document.addEventListener("visibilitychange", () => {
|
||||||
if (!document.hidden) {
|
if (!document.hidden) {
|
||||||
self.onFocus();
|
self.onFocus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
document.addEventListener("beforeunload", self.onFocus);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user