diff options
| -rw-r--r-- | client/js/router.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/client/js/router.js b/client/js/router.js index 460a641..7ba52e3 100644 --- a/client/js/router.js +++ b/client/js/router.js @@ -157,7 +157,10 @@ class Router { window.addEventListener("popstate", this._onPopState, false); document.addEventListener(clickEvent, this._onClick, false); const url = location.pathname + location.search + location.hash; - return this.replace(url, history.state, true); + // clear cached page data, in case we are refreshing the page: + const initialState = Object.assign({}, history.state); + delete initialState.cachedPageData; + return this.replace(url, initialState, true); } stop() { @@ -208,7 +211,7 @@ class Router { const callChain = (this.ctx ? this._exits : []).concat( [swap], this._callbacks, - [this._unhandled, (ctx, next) => {}] + [this._unhandled, (ctx, next) => { }] ); let i = 0; |