mirror of
https://github.com/flarum/core.git
synced 2025-07-22 09:11:19 +02:00
DiscussionPage: call onNewRoute properly
When on a discussion page, the URL changing doesn't always mean we've moved to a different page. In our custom rerender logic, we only want to call `this.onNewRoute()` if the page has actually changed.
This commit is contained in:
@@ -100,7 +100,6 @@ export default class DiscussionPage extends Page {
|
|||||||
super.onbeforeupdate(vnode);
|
super.onbeforeupdate(vnode);
|
||||||
|
|
||||||
if (m.route.get() !== this.prevRoute) {
|
if (m.route.get() !== this.prevRoute) {
|
||||||
this.onNewRoute();
|
|
||||||
this.prevRoute = m.route.get();
|
this.prevRoute = m.route.get();
|
||||||
|
|
||||||
// If we have routed to the same discussion as we were viewing previously,
|
// If we have routed to the same discussion as we were viewing previously,
|
||||||
@@ -118,6 +117,7 @@ export default class DiscussionPage extends Page {
|
|||||||
|
|
||||||
this.near = near;
|
this.near = near;
|
||||||
} else {
|
} else {
|
||||||
|
this.onNewRoute();
|
||||||
this.oninit(vnode);
|
this.oninit(vnode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user