Make accountLookup work with Nostr

This commit is contained in:
Alex Gleason
2024-02-13 20:22:56 -06:00
parent b950a7a052
commit a0a37b7296
7 changed files with 15 additions and 7 deletions

View File

@ -22,7 +22,7 @@ function useAccountLookup(acct: string | undefined, opts: UseAccountLookupOpts =
const { entity: account, isUnauthorized, ...result } = useEntityLookup<Account>(
Entities.ACCOUNTS,
(account) => account.acct.toLowerCase() === acct?.toLowerCase(),
(account) => account.acct.toLowerCase() === acct?.toLowerCase() || account.nostr.npub === acct,
() => api.get(`/api/v1/accounts/lookup?acct=${acct}`),
{ schema: accountSchema, enabled: !!acct },
);