Skip to content

Commit

Permalink
FIX: Only redirect to top from root url.
Browse files Browse the repository at this point in the history
  • Loading branch information
SamSaffron committed Apr 2, 2015
1 parent a764840 commit 04bb1de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/assets/javascripts/discourse/routes/discovery.js.es6
Expand Up @@ -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");
Expand Down

0 comments on commit 04bb1de

Please sign in to comment.