mirror of
https://github.com/flarum/core.git
synced 2025-07-25 18:51:40 +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);
|
||||
|
||||
if (m.route.get() !== this.prevRoute) {
|
||||
this.onNewRoute();
|
||||
this.prevRoute = m.route.get();
|
||||
|
||||
// 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;
|
||||
} else {
|
||||
this.onNewRoute();
|
||||
this.oninit(vnode);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user