mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-12 08:58:50 +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];
|
return result.accounts[0];
|
||||||
} else if (/https?:\/\/[^/]+\/@/.test(account)) {
|
} else if (/https?:\/\/[^/]+\/@/.test(account)) {
|
||||||
const accountURL = new URL(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({
|
const result = await masto.v2.search.fetch({
|
||||||
q: acct,
|
q: acct,
|
||||||
type: 'accounts',
|
type: 'accounts',
|
||||||
|
|
Loading…
Reference in a new issue