Browse Source

gui: Fix NaN percentage for zero byte files (fixes #7002) (#7025)

Felix Lampe 5 years ago
parent
commit
977ee4f06b
1 changed files with 2 additions and 1 deletions
  1. 2 1
      gui/default/syncthing/core/syncthingController.js

+ 2 - 1
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;