From 7d1250620e29704bf1c54aa8bc7fc0e17cb3d106 Mon Sep 17 00:00:00 2001 From: ralder Date: Wed, 10 Jun 2015 16:48:16 +0300 Subject: [PATCH] fix disappeared status of folder after restart syncthing sometimes after restart process syncthing '/rest/db/status' for folder may return data with 'state' = empty string --- .../syncthing/core/controllers/syncthingController.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gui/scripts/syncthing/core/controllers/syncthingController.js b/gui/scripts/syncthing/core/controllers/syncthingController.js index 2aa50e584..1256c951e 100644 --- a/gui/scripts/syncthing/core/controllers/syncthingController.js +++ b/gui/scripts/syncthing/core/controllers/syncthingController.js @@ -521,6 +521,11 @@ angular.module('syncthing.core') if ($scope.model[folderCfg.id].state == 'error') { return 'stopped'; // legacy, the state is called "stopped" in the GUI } + + // after restart syncthing process state may be empty + if (!$scope.model[folderCfg.id].state) { + return 'unknown'; + } return '' + $scope.model[folderCfg.id].state; };