mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 01:03:08 -07: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:
parent
7131d1bd6b
commit
bf7e1516d5
7 changed files with 18 additions and 8 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue