From 977ee4f06b4d69b95ea79750d016328ff1421618 Mon Sep 17 00:00:00 2001 From: Felix Lampe Date: Tue, 6 Oct 2020 17:17:34 +0200 Subject: [PATCH] gui: Fix NaN percentage for zero byte files (fixes #7002) (#7025) --- gui/default/syncthing/core/syncthingController.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js index fba23308e..5af030622 100755 --- a/gui/default/syncthing/core/syncthingController.js +++ b/gui/default/syncthing/core/syncthingController.js @@ -848,10 +848,11 @@ angular.module('syncthing.core') if ($scope.model[folder].needTotalItems === 0) { return 100; } - if ($scope.model[folder].needBytes == 0 && $scope.model[folder].needDeletes > 0) { + if (($scope.model[folder].needBytes == 0 && $scope.model[folder].needDeletes > 0) || $scope.model[folder].globalBytes == 0) { // We don't need any data, but we have deletes that we need // to do. Drop down the completion percentage to indicate // that we have stuff to do. + // Do the same thing in case we only have zero byte files to sync. return 95; } var pct = 100 * $scope.model[folder].inSyncBytes / $scope.model[folder].globalBytes;