From e51fcc6ea084b00fc4d95926177f8ac3d4f676da Mon Sep 17 00:00:00 2001 From: skomerko <168652295+skomerko@users.noreply.github.com> Date: Sun, 17 Nov 2024 08:31:30 +0100 Subject: [PATCH] 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 #21843. --- src/webui/www/private/scripts/contextmenu.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/webui/www/private/scripts/contextmenu.js b/src/webui/www/private/scripts/contextmenu.js index 758783411..876a3792a 100644 --- a/src/webui/www/private/scripts/contextmenu.js +++ b/src/webui/www/private/scripts/contextmenu.js @@ -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) { -- 2.11.4.GIT