From 04bb1de057d251e5b76df5474fbbaf3cc59eed1d Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 2 Apr 2015 12:51:32 +1100 Subject: [PATCH] FIX: Only redirect to top from root url. --- app/assets/javascripts/discourse/routes/discovery.js.es6 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/routes/discovery.js.es6 b/app/assets/javascripts/discourse/routes/discovery.js.es6 index c11e5ede4cc..c12cb9a72c8 100644 --- a/app/assets/javascripts/discourse/routes/discovery.js.es6 +++ b/app/assets/javascripts/discourse/routes/discovery.js.es6 @@ -9,7 +9,8 @@ const DiscoveryRoute = Discourse.Route.extend(Discourse.ScrollTop, Discourse.Ope redirect: function() { return this.redirectIfLoginRequired(); }, beforeModel: function(transition) { - if (transition.targetName.indexOf("discovery.top") === -1 && + if (transition.intent.url === "/" && + transition.targetName.indexOf("discovery.top") === -1 && Discourse.User.currentProp("should_be_redirected_to_top")) { Discourse.User.currentProp("should_be_redirected_to_top", false); this.replaceWith("discovery.top");