Skip to content

Commit e51fcc6

Browse files
authored
WebUI: Show 'Rename...' context menu item only when one torrent is selected
'Rename...' item in torrents table menu is displayed only when exactly one torrent is selected. PR qbittorrent#21843.
1 parent f4eec75 commit e51fcc6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/webui/www/private/scripts/contextmenu.js

+2
Original file line numberDiff line numberDiff line change
@@ -392,13 +392,15 @@ window.qBittorrent.ContextMenu ??= (() => {
392392
const data = torrentsTable.getRow(selectedRows[0]).full_data;
393393
const metadata_downloaded = !((data["state"] === "metaDL") || (data["state"] === "forcedMetaDL") || (data["total_size"] === -1));
394394

395+
this.showItem("rename");
395396
// hide renameFiles when metadata hasn't been downloaded yet
396397
metadata_downloaded
397398
? this.showItem("renameFiles")
398399
: this.hideItem("renameFiles");
399400
}
400401
else {
401402
this.hideItem("renameFiles");
403+
this.hideItem("rename");
402404
}
403405

404406
if (all_are_downloaded) {

0 commit comments

Comments
 (0)