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:
rr-
2017-04-24 23:02:25 +02:00
parent 467b4a7630
commit fea9a94945
4 changed files with 13 additions and 9 deletions

View File

@ -1,6 +1,7 @@
'use strict';
const config = require('../config.js');
const router = require('../router.js');
const api = require('../api.js');
const settings = require('../models/settings.js');
const uri = require('../util/uri.js');
@ -54,9 +55,7 @@ class PostListController {
}
_evtNavigate(e) {
history.pushState(
null,
window.title,
router.showNoDispatch(
uri.formatClientLink('posts', e.detail.parameters));
Object.assign(this._ctx.parameters, e.detail.parameters);
this._syncPageController();