From de6edf9e4e5675db0e4bf13000402ec60ae01cd3 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 5 Jul 2019 15:53:14 -0400 Subject: [PATCH] FIX: Back button would go to previous topic instead of list See related topic: https://meta.discourse.org/t/back-button-history-not-properly-working/122183 The issue here is the transition was not completing properly which meant if you backed out of a topic quickly and entered a new one, hitting back in the second topic would sometimes take you to the previous one instead of back to the topic list. --- .../javascripts/discourse/routes/topic-from-params.js.es6 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/javascripts/discourse/routes/topic-from-params.js.es6 b/app/assets/javascripts/discourse/routes/topic-from-params.js.es6 index c545cffe8d..70f56403e9 100644 --- a/app/assets/javascripts/discourse/routes/topic-from-params.js.es6 +++ b/app/assets/javascripts/discourse/routes/topic-from-params.js.es6 @@ -89,6 +89,10 @@ export default Discourse.Route.extend({ "previousURL", document.location.pathname ); + + // NOTE: omitting this return can break the back button when transitioning quickly between + // topics and the latest page. + return true; } } });