WebUI: use idiomatic string methods

This commit is contained in:
Chocobo1
2024-11-23 03:40:12 +08:00
parent f34787e6ba
commit 5eec0c0213
6 changed files with 11 additions and 11 deletions

View File

@@ -146,7 +146,7 @@ window.qBittorrent.PropTrackers ??= (() => {
onShow: function() {
const selectedTrackers = torrentTrackersTable.selectedRowsIds();
const containsStaticTracker = selectedTrackers.some((tracker) => {
return (tracker.indexOf("** [") === 0);
return tracker.startsWith("** [");
});
if (containsStaticTracker || (selectedTrackers.length === 0)) {