Linearize docsURL implementation

This commit is contained in:
Emil Lundberg
2024-09-21 19:35:38 +02:00
parent b1ed2802fb
commit 9adb239662
@@ -3308,14 +3308,12 @@ angular.module('syncthing.core')
// Undefined or null should become a valid string. // Undefined or null should become a valid string.
path = ''; path = '';
} }
var hash = path.indexOf('#'); var hashIndex = path.indexOf('#');
if (hash != -1) { url += '/' + (hashIndex === -1 ? path : path.slice(0, hashIndex));
url += '/' + path.slice(0, hash); url += '?version=' + $scope.versionBase();
url += '?version=' + $scope.versionBase(); var hash = hashIndex === -1 ? '' : path.slice(hashIndex);
url += path.slice(hash); if (hash) {
} else { url += hash;
url += '/' + path;
url += '?version=' + $scope.versionBase();
} }
return url; return url;
}; };