From 7255066c2527509d947b45fb2a6fabbaf0e25453 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 14 May 2024 12:37:03 -0500 Subject: [PATCH] SImplify handleCopyNpub --- src/features/account/components/header.tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/features/account/components/header.tsx b/src/features/account/components/header.tsx index 01cdc51c9..837b5c976 100644 --- a/src/features/account/components/header.tsx +++ b/src/features/account/components/header.tsx @@ -279,13 +279,7 @@ const Header: React.FC = ({ account }) => { }; const handleCopyNpub: React.EventHandler = (e) => { - // Check if the account object has an 'pubkey' property, convert to npub, and copy it - if (account && account.nostr.pubkey) { - const npub = nip19.npubEncode(account.nostr.pubkey); - copy(npub); - } else { - console.error('Account npub is not available.'); - } + copy(nip19.npubEncode(account.nostr.pubkey!)); }; const makeMenu = () => {