fix: authorize-follow not working due to redeclare 'acct'
This commit is contained in:
parent
ccd26a826f
commit
6a0ad409cd
1 changed files with 5 additions and 5 deletions
|
@ -24,16 +24,16 @@ async function follow(user): Promise<void> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const acct = new URL(location.href).searchParams.get("acct");
|
const acctUri = new URL(location.href).searchParams.get("acct");
|
||||||
if (acct == null) {
|
if (acctUri == null) {
|
||||||
throw new Error("acct required");
|
throw new Error("acct required");
|
||||||
}
|
}
|
||||||
|
|
||||||
let promise;
|
let promise;
|
||||||
|
|
||||||
if (acct.startsWith("https://")) {
|
if (acctUri.startsWith("https://")) {
|
||||||
promise = os.api("ap/show", {
|
promise = os.api("ap/show", {
|
||||||
uri: acct,
|
uri: acctUri,
|
||||||
});
|
});
|
||||||
promise.then((res) => {
|
promise.then((res) => {
|
||||||
if (res.type === "User") {
|
if (res.type === "User") {
|
||||||
|
@ -50,7 +50,7 @@ if (acct.startsWith("https://")) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
promise = os.api("users/show", acct.parse(acct));
|
promise = os.api("users/show", acct.parse(acctUri));
|
||||||
promise.then((user) => {
|
promise.then((user) => {
|
||||||
follow(user);
|
follow(user);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue