diff options
| author | Hunternif | 2022-07-23 22:33:30 +0100 |
|---|---|---|
| committer | Hunternif | 2022-07-24 03:56:24 +0100 |
| commit | 08e9286d050b53fbb686b9b68aad5015647a4857 (patch) | |
| tree | 7de69d3d31efc8bcb352b49a3ffb19b45933cfe4 /client/js/router.js | |
| parent | e443f46e33bdf4d58ebbf6784eec227abf4e6f47 (diff) | |
client: page cache is only used for the same query
Diffstat (limited to 'client/js/router.js')
| -rw-r--r-- | client/js/router.js | 5 |
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(); |