diff --git a/src/webui/www/private/scripts/addtorrent.js b/src/webui/www/private/scripts/addtorrent.js index dd026d8e9..4990eff28 100644 --- a/src/webui/www/private/scripts/addtorrent.js +++ b/src/webui/www/private/scripts/addtorrent.js @@ -241,6 +241,10 @@ window.qBittorrent.AddTorrent ??= (() => { metadataCompleted(); else loadMetadataTimer = loadMetadata.delay(1000); + }, (error) => { + console.error(error); + + loadMetadataTimer = loadMetadata.delay(1000); }); }; diff --git a/src/webui/www/private/scripts/prop-general.js b/src/webui/www/private/scripts/prop-general.js index fce3c84a6..55d154cf7 100644 --- a/src/webui/www/private/scripts/prop-general.js +++ b/src/webui/www/private/scripts/prop-general.js @@ -234,6 +234,12 @@ window.qBittorrent.PropGeneral ??= (() => { } clearTimeout(loadTorrentDataTimer); loadTorrentDataTimer = loadTorrentData.delay(5000); + }, (error) => { + console.error(error); + + document.getElementById("error_div").textContent = "QBT_TR(qBittorrent client is not reachable)QBT_TR[CONTEXT=HttpServer]"; + clearTimeout(loadTorrentDataTimer); + loadTorrentDataTimer = loadTorrentData.delay(10000); }); const pieceStatesURL = new URL("api/v2/torrents/pieceStates", window.location); @@ -262,6 +268,12 @@ window.qBittorrent.PropGeneral ??= (() => { clearTimeout(loadTorrentDataTimer); loadTorrentDataTimer = loadTorrentData.delay(5000); + }, (error) => { + console.error(error); + + document.getElementById("error_div").textContent = "QBT_TR(qBittorrent client is not reachable)QBT_TR[CONTEXT=HttpServer]"; + clearTimeout(loadTorrentDataTimer); + loadTorrentDataTimer = loadTorrentData.delay(10000); }); }; diff --git a/src/webui/www/private/scripts/search.js b/src/webui/www/private/scripts/search.js index c3ab21539..90c099467 100644 --- a/src/webui/www/private/scripts/search.js +++ b/src/webui/www/private/scripts/search.js @@ -917,6 +917,11 @@ window.qBittorrent.Search ??= (() => { clearTimeout(state.loadResultsTimer); state.loadResultsTimer = loadSearchResultsData.delay(2000, this, searchId); + }, (error) => { + console.error(error); + + clearTimeout(state.loadResultsTimer); + state.loadResultsTimer = loadSearchResultsData.delay(3000, this, searchId); }); }; diff --git a/src/webui/www/private/views/log.html b/src/webui/www/private/views/log.html index 5fde56899..2b51b5643 100644 --- a/src/webui/www/private/views/log.html +++ b/src/webui/www/private/views/log.html @@ -416,6 +416,12 @@ tableInfo[curTab].progress = false; syncLogWithInterval(getSyncLogDataInterval()); + }, (error) => { + console.error(error); + + document.getElementById("error_div").textContent = "QBT_TR(qBittorrent client is not reachable)QBT_TR[CONTEXT=HttpServer]"; + tableInfo[curTab].progress = false; + syncLogWithInterval(10000); }); };