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:
Chocobo1 2024-07-26 04:58:21 +08:00
parent 7131d1bd6b
commit bf7e1516d5
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
7 changed files with 18 additions and 8 deletions

View file

@ -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;