FIX: Replace `/my/` URLs before fixing the prefix
This commit is contained in:
parent
33e3746d4d
commit
8e2e962b1a
|
@ -191,13 +191,6 @@ const DiscourseURL = Ember.Object.extend({
|
||||||
const oldPath = window.location.pathname;
|
const oldPath = window.location.pathname;
|
||||||
path = path.replace(/(https?\:)?\/\/[^\/]+/, '');
|
path = path.replace(/(https?\:)?\/\/[^\/]+/, '');
|
||||||
|
|
||||||
// handle prefixes
|
|
||||||
if (path.match(/^\//)) {
|
|
||||||
let rootURL = (Discourse.BaseUri === undefined ? "/" : Discourse.BaseUri);
|
|
||||||
rootURL = rootURL.replace(/\/$/, '');
|
|
||||||
path = path.replace(rootURL, '');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Rewrite /my/* urls
|
// Rewrite /my/* urls
|
||||||
if (path.indexOf('/my/') === 0) {
|
if (path.indexOf('/my/') === 0) {
|
||||||
const currentUser = Discourse.User.current();
|
const currentUser = Discourse.User.current();
|
||||||
|
@ -209,6 +202,13 @@ const DiscourseURL = Ember.Object.extend({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// handle prefixes
|
||||||
|
if (path.match(/^\//)) {
|
||||||
|
let rootURL = (Discourse.BaseUri === undefined ? "/" : Discourse.BaseUri);
|
||||||
|
rootURL = rootURL.replace(/\/$/, '');
|
||||||
|
path = path.replace(rootURL, '');
|
||||||
|
}
|
||||||
|
|
||||||
path = rewritePath(path);
|
path = rewritePath(path);
|
||||||
if (this.navigatedToPost(oldPath, path, opts)) { return; }
|
if (this.navigatedToPost(oldPath, path, opts)) { return; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue