mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-02 14:16:39 +01:00
Fix wrong account shown
Need the hostname to be more accurate
This commit is contained in:
parent
500f877d4b
commit
2b3f65f28c
1 changed files with 5 additions and 1 deletions
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue