aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomasz1986 <twilczynski@naver.com>2022-12-26 12:59:04 +0100
committerGitHub <noreply@github.com>2022-12-26 12:59:04 +0100
commitfb4209e382ffa08d53f96569d91f5c4fe172d622 (patch)
treeb420b485170c57882e6e7f7dd5e26d9c14a572bd
parent473ca68dc4ef956bef4e8cc5b9ad180970b016d5 (diff)
downloadsyncthing-fb4209e382ffa08d53f96569d91f5c4fe172d622.tar.gz
syncthing-fb4209e382ffa08d53f96569d91f5c4fe172d622.zip
gui: Fix undefined lastSeenDays error in disconnected-inactive status check (ref #8530) (#8730)v1.22.3-rc.2
The current code assumes that lastSeenDays is always set which is not the case when device reports its lastSeen as equal to the Unix epoch. Thus, make sure that lastSeenDays is set before proceeding with the disconnected-inactive status check to avoid JS errors in the browser. Signed-off-by: Tomasz WilczyƄski <twilczynski@naver.com>
-rwxr-xr-xgui/default/syncthing/core/syncthingController.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js
index 683504c24..f61f0b0cf 100755
--- a/gui/default/syncthing/core/syncthingController.js
+++ b/gui/default/syncthing/core/syncthingController.js
@@ -1098,7 +1098,7 @@ angular.module('syncthing.core')
}
// Disconnected
- if (!unused && $scope.deviceStats[deviceCfg.deviceID].lastSeenDays >= 7) {
+ if (!unused && $scope.deviceStats[deviceCfg.deviceID].lastSeenDays && $scope.deviceStats[deviceCfg.deviceID].lastSeenDays >= 7) {
return status + 'disconnected-inactive';
} else {
return status + 'disconnected';