Fix back on load [Tizen 2.x]

This commit is contained in:
Dmitry Lyzo
2021-05-10 21:46:24 +03:00
parent e27131edf0
commit cb6ab0f41c
+10 -2
View File
@@ -30,8 +30,16 @@ class AppRouter {
startPages = ['home', 'login', 'selectserver'];
constructor() {
window.addEventListener('popstate', () => {
this.popstateOccurred = true;
// WebKit fires a popstate event on document load
// Skip it using timeout
// For Tizen 2.x
// https://stackoverflow.com/a/12214354
window.addEventListener('load', () => {
setTimeout(() => {
window.addEventListener('popstate', () => {
this.popstateOccurred = true;
});
}, 0);
});
document.addEventListener('viewshow', () => {