1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-26 17:57:59 +00:00

Merge pull request #4383 from milkey-mouse/fix-4133

Only modify window.location when redirecting
This commit is contained in:
TW 2019-02-21 11:25:43 +01:00 committed by GitHub
commit 5ba14e8d95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,7 +17,10 @@ Usage
// Redirect to general docs // Redirect to general docs
if(hash == "") { if(hash == "") {
window.location.pathname = window.location.pathname.replace("usage.html", "usage/general.html"); var replaced = window.location.pathname.replace("usage.html", "usage/general.html");
if (replaced != window.location.pathname) {
window.location.pathname = replaced;
}
} }
// Fixup anchored links from when usage.html contained all the commands // Fixup anchored links from when usage.html contained all the commands
else if(hash.startsWith("borg-key") || hash == "borg-change-passphrase") { else if(hash.startsWith("borg-key") || hash == "borg-change-passphrase") {