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

@@ -27,9 +27,10 @@
}
});
const name = new URI().getData("name");
const searchParams = new URLSearchParams(window.location.search);
const name = searchParams.get("name");
// set text field to current value
if (name)
if (name !== null)
$("rename").value = name;
$("rename").focus();
@@ -42,8 +43,8 @@
if ((name === null) || (name === ""))
return;
const hash = new URI().getData("hash");
if (hash) {
const hash = searchParams.get("hash");
if (hash !== null) {
fetch("api/v2/torrents/rename", {
method: "POST",
body: new URLSearchParams({