WebUI: use native API for accessing query string

PR #22141.
This commit is contained in:
Chocobo1
2025-01-12 21:36:59 +08:00
committed by GitHub
parent 11991e62f5
commit c622d50814
28 changed files with 292 additions and 203 deletions

View File

@@ -56,9 +56,11 @@ window.qBittorrent.PropPeers ??= (() => {
clearTimeout(loadTorrentPeersTimer);
return;
}
const url = new URI("api/v2/sync/torrentPeers")
.setData("rid", syncTorrentPeersLastResponseId)
.setData("hash", current_hash);
const url = new URL("api/v2/sync/torrentPeers", window.location);
url.search = new URLSearchParams({
hash: current_hash,
rid: syncTorrentPeersLastResponseId,
});
fetch(url, {
method: "GET",
cache: "no-store"