gui, lib/model: Fix download progress accounting (fixes #5811) (#5815)

This commit is contained in:
Simon Frei
2019-06-30 09:23:47 +02:00
committed by Jakob Borg
parent 43b6ac9501
commit 863fe23347
4 changed files with 76 additions and 75 deletions

View File

@@ -816,22 +816,6 @@ angular.module('syncthing.core')
return Math.floor(pct);
};
$scope.syncRemaining = function (folder) {
// Remaining sync bytes
if (typeof $scope.model[folder] === 'undefined') {
return 0;
}
if ($scope.model[folder].globalBytes === 0) {
return 0;
}
var bytes = $scope.model[folder].globalBytes - $scope.model[folder].inSyncBytes;
if (isNaN(bytes) || bytes < 0) {
return 0;
}
return bytes;
};
$scope.scanPercentage = function (folder) {
if (!$scope.scanProgress[folder]) {
return undefined;