From 2b3f65f28c56fc939465dabab2813fa57eeeac5f Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Fri, 12 Jan 2024 14:47:59 +0800 Subject: [PATCH] Fix wrong account shown Need the hostname to be more accurate --- src/components/account-sheet.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/account-sheet.jsx b/src/components/account-sheet.jsx index a6af1bfcfa..f0a3bae370 100644 --- a/src/components/account-sheet.jsx +++ b/src/components/account-sheet.jsx @@ -59,7 +59,11 @@ function AccountSheet({ account, instance: propInstance, onClose }) { return result.accounts[0]; } else if (/https?:\/\/[^/]+\/@/.test(account)) { const accountURL = new URL(account); - const acct = accountURL.pathname.replace(/^\//, ''); + const { hostname, pathname } = accountURL; + const acct = + pathname.replace(/^\//, '').replace(/\/$/, '') + + '@' + + hostname; const result = await masto.v2.search.fetch({ q: acct, type: 'accounts',