Skip to content

Commit

Permalink
Fix wrong account shown
Browse files Browse the repository at this point in the history
Need the hostname to be more accurate
  • Loading branch information
cheeaun committed Jan 12, 2024
1 parent 500f877 commit 2b3f65f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/account-sheet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 2b3f65f

Please sign in to comment.