diff options
author | tomasz1986 <twilczynski@naver.com> | 2022-12-26 12:59:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-26 12:59:04 +0100 |
commit | fb4209e382ffa08d53f96569d91f5c4fe172d622 (patch) | |
tree | b420b485170c57882e6e7f7dd5e26d9c14a572bd | |
parent | 473ca68dc4ef956bef4e8cc5b9ad180970b016d5 (diff) |
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-x | gui/default/syncthing/core/syncthingController.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js index 683504c24b..f61f0b0cf7 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'; |