WebUI: Ensure that no concurrent timers exist

This commit is contained in:
Gabriele
2014-12-11 21:22:23 +01:00
parent fdc975d900
commit 7a58a3fe43
4 changed files with 13 additions and 0 deletions

View File

@@ -281,6 +281,7 @@ var loadTorrentFilesData = function() {
var new_hash = myTable.getCurrentTorrentHash();
if (new_hash == "") {
fTable.removeAllRows();
clearTimeout(loadTorrentFilesDataTimer);
loadTorrentFilesDataTimer = loadTorrentFilesData.delay(5000);
return;
}
@@ -295,6 +296,7 @@ var loadTorrentFilesData = function() {
method: 'get',
onFailure: function() {
$('error_div').set('html', '_(qBittorrent client is not reachable)');
clearTimeout(loadTorrentFilesDataTimer);
loadTorrentFilesDataTimer = loadTorrentFilesData.delay(10000);
},
onSuccess: function(files) {
@@ -334,6 +336,7 @@ var loadTorrentFilesData = function() {
else {
fTable.removeAllRows();
}
clearTimeout(loadTorrentFilesDataTimer);
loadTorrentFilesDataTimer = loadTorrentFilesData.delay(5000);
}
}).send();