mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
client/routing: fix certain history bug
The bug could be reproduced as follows: 1. Navigate to /posts 2. Search for "test" 3. Navigate to /posts again 4. Refresh the page The user should see plain post list, but instead they were seeing the "test" search results again as if step 3 never happened.
This commit is contained in:
@ -158,6 +158,13 @@ class Router {
|
||||
window.removeEventListener('popstate', this._onPopState, false);
|
||||
}
|
||||
|
||||
showNoDispatch(path, state) {
|
||||
const ctx = new Context(path, state);
|
||||
ctx.pushState();
|
||||
this.ctx = ctx;
|
||||
return ctx;
|
||||
}
|
||||
|
||||
show(path, state, push) {
|
||||
const ctx = new Context(path, state);
|
||||
const oldPath = this.ctx ? this.ctx.path : ctx.path;
|
||||
|
Reference in New Issue
Block a user