From 6a0ad409cdb1cd81e1cc0d630259d9708e9dc9db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=91=A8=E9=83=A8=E8=90=BD?= Date: Tue, 23 Apr 2024 20:07:52 +0800 Subject: [PATCH] fix: authorize-follow not working due to redeclare 'acct' --- packages/client/src/pages/follow.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/client/src/pages/follow.vue b/packages/client/src/pages/follow.vue index a8708978ef..3be549537f 100644 --- a/packages/client/src/pages/follow.vue +++ b/packages/client/src/pages/follow.vue @@ -24,16 +24,16 @@ async function follow(user): Promise { }); } -const acct = new URL(location.href).searchParams.get("acct"); -if (acct == null) { +const acctUri = new URL(location.href).searchParams.get("acct"); +if (acctUri == null) { throw new Error("acct required"); } let promise; -if (acct.startsWith("https://")) { +if (acctUri.startsWith("https://")) { promise = os.api("ap/show", { - uri: acct, + uri: acctUri, }); promise.then((res) => { if (res.type === "User") { @@ -50,7 +50,7 @@ if (acct.startsWith("https://")) { } }); } else { - promise = os.api("users/show", acct.parse(acct)); + promise = os.api("users/show", acct.parse(acctUri)); promise.then((user) => { follow(user); });