mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-30 19:40:18 -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
|
@ -47,7 +47,7 @@ window.qBittorrent.Search ??= (() => {
|
|||
};
|
||||
|
||||
const searchTabIdPrefix = "Search-";
|
||||
let loadSearchPluginsTimer;
|
||||
let loadSearchPluginsTimer = -1;
|
||||
const searchPlugins = [];
|
||||
let prevSearchPluginsResponse;
|
||||
let selectedCategory = "QBT_TR(All categories)QBT_TR[CONTEXT=SearchEngineWidget]";
|
||||
|
@ -207,7 +207,7 @@ window.qBittorrent.Search ??= (() => {
|
|||
rowId: 0,
|
||||
selectedRowIds: [],
|
||||
running: true,
|
||||
loadResultsTimer: null,
|
||||
loadResultsTimer: -1,
|
||||
sort: { column: searchResultsTable.sortedColumn, reverse: searchResultsTable.reverseSort },
|
||||
});
|
||||
updateSearchResultsData(searchId);
|
||||
|
@ -507,6 +507,7 @@ window.qBittorrent.Search ??= (() => {
|
|||
},
|
||||
onClose: function() {
|
||||
clearTimeout(loadSearchPluginsTimer);
|
||||
loadSearchPluginsTimer = -1;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -569,6 +570,7 @@ window.qBittorrent.Search ??= (() => {
|
|||
if (state) {
|
||||
state.running = false;
|
||||
clearTimeout(state.loadResultsTimer);
|
||||
state.loadResultsTimer = -1;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue