mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -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
|
@ -306,6 +306,8 @@ window.qBittorrent.PropFiles ??= (() => {
|
|||
return;
|
||||
|
||||
clearTimeout(loadTorrentFilesDataTimer);
|
||||
loadTorrentFilesDataTimer = -1;
|
||||
|
||||
new Request({
|
||||
url: "api/v2/torrents/filePrio",
|
||||
method: "post",
|
||||
|
@ -331,7 +333,7 @@ window.qBittorrent.PropFiles ??= (() => {
|
|||
torrentFilesTable.updateTable(false);
|
||||
};
|
||||
|
||||
let loadTorrentFilesDataTimer;
|
||||
let loadTorrentFilesDataTimer = -1;
|
||||
const loadTorrentFilesData = function() {
|
||||
if ($("prop_files").hasClass("invisible")
|
||||
|| $("propertiesPanel_collapseToggle").hasClass("panel-expand")) {
|
||||
|
@ -378,6 +380,7 @@ window.qBittorrent.PropFiles ??= (() => {
|
|||
|
||||
const updateData = function() {
|
||||
clearTimeout(loadTorrentFilesDataTimer);
|
||||
loadTorrentFilesDataTimer = -1;
|
||||
loadTorrentFilesData();
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue