mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-17 19:12:37 -05:00
Merge pull request #650 from wojciechka/double_prefix_fix
Detect and remove prefix being added twice when going to pages already in history
This commit is contained in:
commit
5ba9e484f8
1 changed files with 7 additions and 0 deletions
|
@ -174,6 +174,13 @@ Ember.DiscourseLocation = Ember.Object.extend({
|
||||||
rootURL = rootURL.replace(/\/$/, '');
|
rootURL = rootURL.replace(/\/$/, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// remove prefix from URL if it is already in url - i.e. /discourse/t/... -> /t/if rootURL is /discourse
|
||||||
|
// this sometimes happens when navigating to already visited location
|
||||||
|
if ((rootURL.length > 1) && (url.substring(0, rootURL.length + 1) === (rootURL + "/")))
|
||||||
|
{
|
||||||
|
url = url.substring(rootURL.length);
|
||||||
|
}
|
||||||
|
|
||||||
return rootURL + url;
|
return rootURL + url;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue