mirror of
https://github.com/flarum/core.git
synced 2025-08-08 17:36:38 +02:00
do not use custom route resolver solution for plain index page
This commit is contained in:
committed by
Franz Liedke
parent
b78db0268a
commit
7d5bebb70a
@@ -29,23 +29,33 @@ export default class IndexPage extends Page {
|
||||
this.lastDiscussion = app.previous.get('discussion');
|
||||
}
|
||||
|
||||
if (app.previous.matches(IndexPage)) {
|
||||
app.discussions.clear();
|
||||
}
|
||||
|
||||
app.discussions.refreshParams(app.search.params());
|
||||
|
||||
app.history.push('index', app.translator.trans('core.forum.header.back_to_index_tooltip'));
|
||||
|
||||
this.bodyClass = 'App--index';
|
||||
|
||||
this.currentPath = m.route.get();
|
||||
}
|
||||
|
||||
static onroutematch() {
|
||||
// If the user is coming from the discussion list, then they have either
|
||||
// just switched one of the parameters (filter, sort, search) or they
|
||||
// probably want to refresh the results. We will clear the discussion list
|
||||
// cache so that results are reloaded.
|
||||
if (app.current.matches(IndexPage)) {
|
||||
onbeforeupdate(vnode) {
|
||||
super.onbeforeupdate(vnode);
|
||||
|
||||
const curPath = m.route.get();
|
||||
|
||||
if (this.currentPath !== curPath) {
|
||||
app.discussions.clear();
|
||||
|
||||
app.discussions.refreshParams(app.search.params());
|
||||
|
||||
this.currentPath = curPath;
|
||||
}
|
||||
|
||||
console.log('IndexPage#onbeforeupdate');
|
||||
}
|
||||
|
||||
view() {
|
||||
|
@@ -21,7 +21,7 @@ const match = (component) => ({
|
||||
*/
|
||||
export default function (app) {
|
||||
app.routes = {
|
||||
index: { path: '/all', component: match(IndexPage) },
|
||||
index: { path: '/all', component: IndexPage },
|
||||
|
||||
discussion: { path: '/d/:id', component: DiscussionPage },
|
||||
'discussion.near': { path: '/d/:id/:near', component: DiscussionPage },
|
||||
|
Reference in New Issue
Block a user