Don't trust response header (fixes #2186)
Either Angular or the browser sometimes returns cached repsonse header, causing a flap between requests that return the new version and requests that return the old one. Here, instead, we trust the actual data returned by the uncached /rest/system/version call.
This commit is contained in:
@@ -89,6 +89,12 @@ angular.module('syncthing.core')
|
||||
refreshFolderStats();
|
||||
|
||||
$http.get(urlbase + '/system/version').success(function (data) {
|
||||
if ($scope.version.version && $scope.version.version != data.version) {
|
||||
// We already have a version response, but it differs from
|
||||
// the new one. Reload the full GUI in case it's changed.
|
||||
document.location.reload(true);
|
||||
}
|
||||
|
||||
$scope.version = data;
|
||||
}).error($scope.emitHTTPError);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user