WebUI: Clear properties panel when torrent no longer selected

PR #21654.
This commit is contained in:
Thomas Piccirello 2024-10-27 22:53:24 -07:00 committed by GitHub
parent e0431e3ffb
commit c3c91be578
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 61 additions and 10 deletions

View file

@ -42,7 +42,8 @@ window.qBittorrent.PropFiles ??= (() => {
updateData: updateData,
collapseIconClicked: collapseIconClicked,
expandFolder: expandFolder,
collapseFolder: collapseFolder
collapseFolder: collapseFolder,
clear: clear
};
};
@ -343,7 +344,6 @@ window.qBittorrent.PropFiles ??= (() => {
if (new_hash === "") {
torrentFilesTable.clear();
clearTimeout(loadTorrentFilesDataTimer);
loadTorrentFilesDataTimer = loadTorrentFilesData.delay(5000);
return;
}
let loadedNewTorrent = false;
@ -764,6 +764,10 @@ window.qBittorrent.PropFiles ??= (() => {
});
};
const clear = function() {
torrentFilesTable.clear();
};
return exports();
})();
Object.freeze(window.qBittorrent.PropFiles);