mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 14:38:04 -06:00
WebUI: clear timer variable properly
In JS the timer handle pool is reused and therefore require careful handling of it.
This commit is contained in:
@@ -705,7 +705,7 @@ window.addEventListener("DOMContentLoaded", () => {
|
||||
};
|
||||
})();
|
||||
|
||||
let syncMainDataTimeoutID;
|
||||
let syncMainDataTimeoutID = -1;
|
||||
let syncRequestInProgress = false;
|
||||
const syncMainData = function() {
|
||||
const url = new URI("api/v2/sync/maindata");
|
||||
@@ -889,6 +889,7 @@ window.addEventListener("DOMContentLoaded", () => {
|
||||
return;
|
||||
|
||||
clearTimeout(syncMainDataTimeoutID);
|
||||
syncMainDataTimeoutID = -1;
|
||||
|
||||
if (window.qBittorrent.Client.isStopped())
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user