Fix back button -again-
All checks were successful
Deploy Spot / deploy (push) Successful in 35s

This commit is contained in:
2026-06-11 15:57:42 +02:00
parent 9718713eb4
commit 7ecd8094e2

View File

@@ -41,9 +41,7 @@ export default {
this.updateMobile();
//Set initial page
let asInitHash = this.getBrowserHash();
if(!asInitHash.page) asInitHash.page = this.consts.default_page;
this.setVarHash(asInitHash);
this.setVarHash(this.validateRoute(this.getBrowserHash()));
},
mounted() {
//Catch browser hash change
@@ -51,7 +49,7 @@ export default {
},
watch: {
hashSnapshot(jNewHash, jOldHash) {
const asNewHash = JSON.parse(jNewHash);
const asNewHash = this.validateRoute(JSON.parse(jNewHash));
//Sync variable -> #hash
if(asNewHash != this.getBrowserHash()) {
@@ -97,6 +95,10 @@ export default {
},
getPrevAnchor() {
return this.getAnchor([this.hash.prev.page, ...this.hash.prev.items]);
},
validateRoute(asHash) {
if(!Object.keys(aoRoutes).includes(asHash.page)) asHash.page = this.consts.default_page;
return asHash;
}
},
beforeUnmount() {