fix js problems pointed-out by linter

This commit is contained in:
Stiliyan Tonev (Bark) 2025-05-12 15:50:16 +03:00
commit 7b21b078c1

View file

@ -180,14 +180,10 @@ window.qBittorrent.PropTrackers ??= (() => {
const addTrackerFN = () => { const addTrackerFN = () => {
const selectedTorrents = torrentsTable.selectedRowsIds(); const selectedTorrents = torrentsTable.selectedRowsIds();
if (current_hash.length === 0) if (current_hash.length === 0)
{
return; return;
}
if (selectedTorrents.length !== 0) if (selectedTorrents.length !== 0)
{
current_hash = selectedTorrents.map(encodeURIComponent).join("|"); current_hash = selectedTorrents.map(encodeURIComponent).join("|");
}
new MochaUI.Window({ new MochaUI.Window({
id: "trackersPage", id: "trackersPage",
@ -237,14 +233,10 @@ window.qBittorrent.PropTrackers ??= (() => {
const removeTrackerFN = (element) => { const removeTrackerFN = (element) => {
const selectedTorrents = torrentsTable.selectedRowsIds(); const selectedTorrents = torrentsTable.selectedRowsIds();
if (current_hash.length === 0) if (current_hash.length === 0)
{
return; return;
}
if (selectedTorrents.length !== 0) if (selectedTorrents.length !== 0)
{
current_hash = selectedTorrents.map(encodeURIComponent).join("|"); current_hash = selectedTorrents.map(encodeURIComponent).join("|");
}
fetch("api/v2/torrents/removeTrackers", { fetch("api/v2/torrents/removeTrackers", {
method: "POST", method: "POST",