mirror of
https://github.com/discourse/discourse.git
synced 2025-05-19 05:13:09 +08:00
FIX: Only redirect to top from root url.
This commit is contained in:
parent
a764840794
commit
04bb1de057
@ -9,7 +9,8 @@ const DiscoveryRoute = Discourse.Route.extend(Discourse.ScrollTop, Discourse.Ope
|
|||||||
redirect: function() { return this.redirectIfLoginRequired(); },
|
redirect: function() { return this.redirectIfLoginRequired(); },
|
||||||
|
|
||||||
beforeModel: function(transition) {
|
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")) {
|
||||||
Discourse.User.currentProp("should_be_redirected_to_top", false);
|
Discourse.User.currentProp("should_be_redirected_to_top", false);
|
||||||
this.replaceWith("discovery.top");
|
this.replaceWith("discovery.top");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user