From d81f2497573304b1ad07ffef19707cf558d903c7 Mon Sep 17 00:00:00 2001 From: austinkelsay Date: Sat, 8 Feb 2025 14:21:53 -0600 Subject: [PATCH] Fix isNostrLinked condition for users with ephemeral privkey in local storage --- src/components/profile/UserAccountLinking.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/profile/UserAccountLinking.js b/src/components/profile/UserAccountLinking.js index 9d2d1bd..b803861 100644 --- a/src/components/profile/UserAccountLinking.js +++ b/src/components/profile/UserAccountLinking.js @@ -11,7 +11,10 @@ import { useSession } from 'next-auth/react'; import MoreInfo from '@/components/MoreInfo'; const LinkAccountsCard = ({ session }) => { - const isNostrLinked = session?.user?.pubkey && !session?.user?.privkey; + // nostr is linked if we have the pubkey but not the privkey in the session OR in local storage + const isNostrLinked = session?.user?.pubkey && + (!session?.user?.privkey || session?.user?.privkey === '') && + !localStorage.getItem('anonymousPrivkey'); const isGithubLinked = session?.account?.provider === 'github'; const isEmailLinked = Boolean(session?.user?.email); const windowWidth = useWindowWidth();