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
7 changed files with 18 additions and 8 deletions

View File

@@ -37,7 +37,7 @@ window.qBittorrent.PropPeers ??= (() => {
};
const torrentPeersTable = new window.qBittorrent.DynamicTable.TorrentPeersTable();
let loadTorrentPeersTimer;
let loadTorrentPeersTimer = -1;
let syncTorrentPeersLastResponseId = 0;
let show_flags = true;
@@ -109,6 +109,7 @@ window.qBittorrent.PropPeers ??= (() => {
const updateData = function() {
clearTimeout(loadTorrentPeersTimer);
loadTorrentPeersTimer = -1;
loadTorrentPeersData();
};