mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 23:17:21 -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:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user