From fd2567748f90155aa0b261b4d7dc64828e27844e Mon Sep 17 00:00:00 2001 From: Audrius Butkevicius Date: Fri, 29 Aug 2014 23:24:26 +0100 Subject: [PATCH] Fix GUI breaking during restarts (fixes #577) --- gui/app.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gui/app.js b/gui/app.js index 916e2c52..86c2f0b7 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) {