From 245f3c68469d2bfb2060a8508c47a03f7cd2c798 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. --- js/src/forum/components/DiscussionPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/forum/components/DiscussionPage.js b/js/src/forum/components/DiscussionPage.js index 3ad1287f2..383ad27c2 100644 --- a/js/src/forum/components/DiscussionPage.js +++ b/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); } }