Fix wrong account shown

Need the hostname to be more accurate
pull/397/head
Lim Chee Aun 2024-01-12 14:47:59 +08:00
rodzic 500f877d4b
commit 2b3f65f28c
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -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',