WebUI: Show 'Rename...' context menu item only when one torrent is selected
Some checks failed
CI - File health / Check (push) Has been cancelled
CI - macOS / Build (1.2.19, GUI=OFF, 6.7.0) (push) Has been cancelled
CI - macOS / Build (1.2.19, GUI=ON, 6.7.0) (push) Has been cancelled
CI - macOS / Build (2.0.10, GUI=OFF, 6.7.0) (push) Has been cancelled
CI - macOS / Build (2.0.10, GUI=ON, 6.7.0) (push) Has been cancelled
CI - Python / Check (push) Has been cancelled
CI - Ubuntu / Build (1.2.19, GUI=OFF, 6.5.2) (push) Has been cancelled
CI - Ubuntu / Build (1.2.19, GUI=ON, 6.5.2) (push) Has been cancelled
CI - Ubuntu / Build (2.0.10, GUI=OFF, 6.5.2) (push) Has been cancelled
CI - Ubuntu / Build (2.0.10, GUI=ON, 6.5.2) (push) Has been cancelled
CI - WebUI / Check (push) Has been cancelled
CI - Windows / Build (1.2.19) (push) Has been cancelled
CI - Windows / Build (2.0.10) (push) Has been cancelled

'Rename...' item in torrents table menu is displayed only when exactly one torrent is selected.

PR #21843.
This commit is contained in:
skomerko 2024-11-17 08:31:30 +01:00 committed by GitHub
parent f4eec75488
commit e51fcc6ea0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -392,6 +392,7 @@ window.qBittorrent.ContextMenu ??= (() => {
const data = torrentsTable.getRow(selectedRows[0]).full_data;
const metadata_downloaded = !((data["state"] === "metaDL") || (data["state"] === "forcedMetaDL") || (data["total_size"] === -1));
this.showItem("rename");
// hide renameFiles when metadata hasn't been downloaded yet
metadata_downloaded
? this.showItem("renameFiles")
@ -399,6 +400,7 @@ window.qBittorrent.ContextMenu ??= (() => {
}
else {
this.hideItem("renameFiles");
this.hideItem("rename");
}
if (all_are_downloaded) {