Linearize docsURL implementation

This commit is contained in:
Emil Lundberg
2024-09-21 19:23:04 +02:00
parent b1ed2802fb
commit 9adb239662

View File

@@ -3308,14 +3308,12 @@ angular.module('syncthing.core')
// Undefined or null should become a valid string.
path = '';
}
var hash = path.indexOf('#');
if (hash != -1) {
url += '/' + path.slice(0, hash);
url += '?version=' + $scope.versionBase();
url += path.slice(hash);
} else {
url += '/' + path;
url += '?version=' + $scope.versionBase();
var hashIndex = path.indexOf('#');
url += '/' + (hashIndex === -1 ? path : path.slice(0, hashIndex));
url += '?version=' + $scope.versionBase();
var hash = hashIndex === -1 ? '' : path.slice(hashIndex);
if (hash) {
url += hash;
}
return url;
};