aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Borg <jakob@nym.se>2014-08-31 21:30:51 +0200
committerJakob Borg <jakob@nym.se>2014-08-31 21:30:51 +0200
commitdab434020770817e8a07e642d4fb5b62ad14a7e4 (patch)
tree644f5eac0432a6fc5fed7c4c6c45e1d66f876bef
parentcf1bfdfb619f9ed9b59de1cf1bef9779fbea7f10 (diff)
parentfd2567748f90155aa0b261b4d7dc64828e27844e (diff)
downloadsyncthing-dab434020770817e8a07e642d4fb5b62ad14a7e4.tar.gz
syncthing-dab434020770817e8a07e642d4fb5b62ad14a7e4.zip
Merge pull request #603 from AudriusButkevicius/restart
Fix GUI breaking during restarts (fixes #577)
-rw-r--r--gui/app.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/gui/app.js b/gui/app.js
index 916e2c528..86c2f0b70 100644
--- a/gui/app.js
+++ b/gui/app.js
@@ -25,6 +25,16 @@ syncthing.controller('EventCtrl', function ($scope, $http) {
var lastID = 0;
var successFn = function (data) {
+ // When Syncthing restarts while the long polling connection is in
+ // progress the browser on some platforms returns a 200 (since the
+ // headers has been flushed with the return code 200), with no data.
+ // This basically means that the connection has been reset, and the call
+ // was not actually sucessful.
+ if (!data) {
+ errorFn(data);
+ return;
+ }
+
$scope.$emit('UIOnline');
if (lastID > 0) {