diff --git a/src/pages/profile/index.tsx b/src/pages/profile/index.tsx index e452949..e3cb803 100644 --- a/src/pages/profile/index.tsx +++ b/src/pages/profile/index.tsx @@ -14,6 +14,7 @@ import { LoadingButton } from '@mui/lab' import { Dispatch } from '../../store/store' import { setMetadataEvent } from '../../store/actions' import { LoadingSpinner } from '../../components/LoadingSpinner' +import { LoginMethods } from '../../store/auth/types' export const ProfilePage = () => { const { npub } = useParams() @@ -28,7 +29,7 @@ export const ProfilePage = () => { const [savingProfileMetadata, setSavingProfileMetadata] = useState(false) const metadataState = useSelector((state: State) => state.metadata) const keys = useSelector((state: State) => state.auth?.keyPair) - const usersPubkey = useSelector((state: State) => state.auth.usersPubkey) + const { usersPubkey, loginMethod } = useSelector((state: State) => state.auth) const [isUsersOwnProfile, setIsUsersOwnProfile] = useState(false) @@ -226,10 +227,10 @@ export const ProfilePage = () => { {editItem('about', 'About', true, 4)} {isUsersOwnProfile && ( <> - {keys && - keys.public && - copyItem(nip19.npubEncode(keys.public), 'Public Key')} - {keys && + {usersPubkey && + copyItem(nip19.npubEncode(usersPubkey), 'Public Key')} + {loginMethod === LoginMethods.privateKey && + keys && keys.private && copyItem( '••••••••••••••••••••••••••••••••••••••••••••••••••',