Fix GUI breaking during restarts (fixes #577)

This commit is contained in:
Audrius Butkevicius 2014-08-29 23:24:26 +01:00
parent cf1bfdfb61
commit fd2567748f
1 changed files with 10 additions and 0 deletions

View File

@ -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) {