From e4e79982dd3c447a4ced762a6069db553e246f59 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 28 May 2014 18:18:34 +0200 Subject: Fixed some bugs from Sateserver v05 --- script/taskmanager.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'script') diff --git a/script/taskmanager.js b/script/taskmanager.js index a34b3aa4..822d1421 100644 --- a/script/taskmanager.js +++ b/script/taskmanager.js @@ -10,7 +10,8 @@ function tmInit() return; tmItems.each(function(i, item) { item = $(item); - if (item.find('.data-tm-icon').length !== 0) return; + if (item.find('.data-tm-icon').length !== 0) + return; if (item.is('[data-tm-progress]')) { item.append('
'); } @@ -38,17 +39,16 @@ function tmUpdate() return; $.post('api.php?do=taskmanager', {'ids[]': active, token: TOKEN}, function(data, status) { // POST success - tmIsRunning = tmResult(data, status) + tmIsRunning = tmResult(data, status); if (tmIsRunning) { setTimeout(tmUpdate, 1000); } }, 'json').fail(function(jqXHR, textStatus, errorThrown) { // POST failure console.log("TaskManager Error: " + textStatus + " - " + errorThrown); - if (++tmErrors < TM_MAX_ERRORS) + tmIsRunning = (++tmErrors < TM_MAX_ERRORS); + if (tmIsRunning) setTimeout(tmUpdate, 2000); - else - tmIsRunning = false; }); } -- cgit v1.2.3-55-g7522