gui: Fix division by zero in completion calc (ref #3493)
This commit is contained in:
parent
7776839c82
commit
fa8f339478
|
@ -447,7 +447,11 @@ angular.module('syncthing.core')
|
||||||
total += $scope.completion[device][folder].globalBytes;
|
total += $scope.completion[device][folder].globalBytes;
|
||||||
needed += $scope.completion[device][folder].needBytes;
|
needed += $scope.completion[device][folder].needBytes;
|
||||||
}
|
}
|
||||||
|
if (total == 0) {
|
||||||
|
$scope.completion[device]._total = 100;
|
||||||
|
} else {
|
||||||
$scope.completion[device]._total = 100 * (1 - needed / total);
|
$scope.completion[device]._total = 100 * (1 - needed / total);
|
||||||
|
}
|
||||||
|
|
||||||
console.log("recalcCompletion", device, $scope.completion[device]);
|
console.log("recalcCompletion", device, $scope.completion[device]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue