From 87c8f60cd41ff3c3a17b0caf09fe5836e1722367 Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Wed, 7 Oct 2020 16:22:41 -0400 Subject: [PATCH] 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. --- framework/core/js/src/forum/components/DiscussionPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/core/js/src/forum/components/DiscussionPage.js b/framework/core/js/src/forum/components/DiscussionPage.js index 3ad1287f2..383ad27c2 100644 --- a/framework/core/js/src/forum/components/DiscussionPage.js +++ b/framework/core/js/src/forum/components/DiscussionPage.js @@ -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); } }