Use pubkey instead of npub
This commit is contained in:
parent
37cc1e88f6
commit
34bd5b5020
2 changed files with 5 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
|||
import { NSchema as n } from '@soapbox/nspec';
|
||||
import { nip19 } from 'nostr-tools';
|
||||
import React, { useMemo, useState } from 'react';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
|
||||
|
@ -62,6 +63,8 @@ const AccountStep: React.FC<IAccountStep> = ({ accountId, setStep, onClose }) =>
|
|||
return <ModalLoading />;
|
||||
}
|
||||
|
||||
const acct = account.nostr.pubkey ? nip19.npubEncode(account.nostr.pubkey) : account.acct;
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title={<FormattedMessage id='nostr_signin.account.title' defaultMessage='Your account' />}
|
||||
|
@ -81,7 +84,7 @@ const AccountStep: React.FC<IAccountStep> = ({ accountId, setStep, onClose }) =>
|
|||
truncate
|
||||
/>
|
||||
|
||||
<Tooltip text={account.nostr.npub ?? account.acct}>
|
||||
<Tooltip text={acct}>
|
||||
<Text size='sm' theme='muted' align='center' truncate>
|
||||
{username}
|
||||
</Text>
|
||||
|
|
|
@ -53,7 +53,7 @@ const baseAccountSchema = z.object({
|
|||
z.null(),
|
||||
]).catch(null),
|
||||
nostr: coerceObject({
|
||||
npub: n.bech32().optional().catch(undefined),
|
||||
pubkey: n.id().optional().catch(undefined),
|
||||
}),
|
||||
note: contentSchema,
|
||||
/** Fedibird extra settings. */
|
||||
|
|
Loading…
Reference in a new issue