Skip to content

Commit

Permalink
WebUI: Show 'Edit tracker URL...' only when one tracker is selected
Browse files Browse the repository at this point in the history
We can only edit one URL through the dialog, so there's no point in showing this context option when more than one tracker is selected in trackers table.

PR #22311.
  • Loading branch information
skomerko authored Feb 25, 2025
1 parent 41d9ee9 commit f432c1e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/webui/www/private/scripts/prop-trackers.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ window.qBittorrent.PropTrackers ??= (() => {
addTrackerFN();
},
EditTracker: (element, ref) => {
// only allow editing of one row
element.firstElementChild.click();
editTrackerFN(element);
},
RemoveTracker: (element, ref) => {
Expand All @@ -162,7 +160,11 @@ window.qBittorrent.PropTrackers ??= (() => {
this.hideItem("CopyTrackerUrl");
}
else {
this.showItem("EditTracker");
if (selectedTrackers.length === 1)
this.showItem("EditTracker");
else
this.hideItem("EditTracker");

this.showItem("RemoveTracker");
this.showItem("CopyTrackerUrl");
}
Expand Down

0 comments on commit f432c1e

Please sign in to comment.