SImplify handleCopyNpub

This commit is contained in:
Alex Gleason 2024-05-14 12:37:03 -05:00
parent 790b3aa8c2
commit 7255066c25
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 1 additions and 7 deletions

View File

@ -279,13 +279,7 @@ const Header: React.FC<IHeader> = ({ account }) => {
}; };
const handleCopyNpub: React.EventHandler<React.MouseEvent> = (e) => { const handleCopyNpub: React.EventHandler<React.MouseEvent> = (e) => {
// Check if the account object has an 'pubkey' property, convert to npub, and copy it copy(nip19.npubEncode(account.nostr.pubkey!));
if (account && account.nostr.pubkey) {
const npub = nip19.npubEncode(account.nostr.pubkey);
copy(npub);
} else {
console.error('Account npub is not available.');
}
}; };
const makeMenu = () => { const makeMenu = () => {