aboutsummaryrefslogtreecommitdiff
path: root/client/js/router.js
diff options
context:
space:
mode:
authorHunternif2022-07-23 22:33:30 +0100
committerHunternif2022-07-24 03:56:24 +0100
commit08e9286d050b53fbb686b9b68aad5015647a4857 (patch)
tree7de69d3d31efc8bcb352b49a3ffb19b45933cfe4 /client/js/router.js
parente443f46e33bdf4d58ebbf6784eec227abf4e6f47 (diff)
client: page cache is only used for the same query
Diffstat (limited to 'client/js/router.js')
-rw-r--r--client/js/router.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/client/js/router.js b/client/js/router.js
index 7ba52e3..c697246 100644
--- a/client/js/router.js
+++ b/client/js/router.js
@@ -159,7 +159,7 @@ class Router {
const url = location.pathname + location.search + location.hash;
// clear cached page data, in case we are refreshing the page:
const initialState = Object.assign({}, history.state);
- delete initialState.cachedPageData;
+ delete initialState.pageCache;
return this.replace(url, initialState, true);
}
@@ -175,6 +175,7 @@ class Router {
showNoDispatch(path, state) {
const ctx = new Context(path, state);
ctx.pushState();
+ // replaces old ctx with the current ctx (new page + history state)
this.ctx = ctx;
return ctx;
}
@@ -204,6 +205,7 @@ class Router {
dispatch(ctx, middle) {
const swap = (_ctx, next) => {
+ // replaces old ctx with the current ctx (new page + history state)
this.ctx = ctx;
middle();
next();
@@ -216,6 +218,7 @@ class Router {
let i = 0;
let fn = () => {
+ // Passes old ctx into the callbacks
callChain[i++](this.ctx, fn);
};
fn();

© 2015 - 2026 Jakob L. Kreuze