mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-21 16:07:23 -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:
@@ -72,7 +72,7 @@ window.qBittorrent.PropGeneral ??= (() => {
|
||||
piecesBar.clear();
|
||||
};
|
||||
|
||||
let loadTorrentDataTimer;
|
||||
let loadTorrentDataTimer = -1;
|
||||
const loadTorrentData = function() {
|
||||
if ($("prop_general").hasClass("invisible")
|
||||
|| $("propertiesPanel_collapseToggle").hasClass("panel-expand")) {
|
||||
@@ -250,6 +250,7 @@ window.qBittorrent.PropGeneral ??= (() => {
|
||||
|
||||
const updateData = function() {
|
||||
clearTimeout(loadTorrentDataTimer);
|
||||
loadTorrentDataTimer = -1;
|
||||
loadTorrentData();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user