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

@@ -88,7 +88,7 @@ window.qBittorrent.PropWebseeds ??= (() => {
let current_hash = "";
let loadWebSeedsDataTimer;
let loadWebSeedsDataTimer = -1;
const loadWebSeedsData = function() {
if ($("prop_webseeds").hasClass("invisible")
|| $("propertiesPanel_collapseToggle").hasClass("panel-expand")) {
@@ -138,6 +138,7 @@ window.qBittorrent.PropWebseeds ??= (() => {
const updateData = function() {
clearTimeout(loadWebSeedsDataTimer);
loadWebSeedsDataTimer = -1;
loadWebSeedsData();
};