diff --git a/src/components/Buttons/ButtonFollow.tsx b/src/components/Buttons/ButtonFollow.tsx index 70a31f1..8224d12 100644 --- a/src/components/Buttons/ButtonFollow.tsx +++ b/src/components/Buttons/ButtonFollow.tsx @@ -36,7 +36,8 @@ const ButtonFollow: Component<{ if (!account || !account.hasPublicKey() || !props.person) { - toast?.sendWarning(intl.formatMessage(t.needToLogin)) + account?.actions.showGetStarted(); + // toast?.sendWarning(intl.formatMessage(t.needToLogin)) return; } diff --git a/src/components/FollowButton/FollowButton.tsx b/src/components/FollowButton/FollowButton.tsx index 3646f0c..338e3cb 100644 --- a/src/components/FollowButton/FollowButton.tsx +++ b/src/components/FollowButton/FollowButton.tsx @@ -29,7 +29,8 @@ const FollowButton: Component<{ const onFollow = (e: MouseEvent) => { e.preventDefault(); if (!account || !account.hasPublicKey() || !props.person) { - toast?.sendWarning(intl.formatMessage(t.needToLogin)) + account?.actions.showGetStarted(); + // toast?.sendWarning(intl.formatMessage(t.needToLogin)) return; } diff --git a/src/components/Note/NoteFooter/NoteFooter.tsx b/src/components/Note/NoteFooter/NoteFooter.tsx index a4b9748..04f5c89 100644 --- a/src/components/Note/NoteFooter/NoteFooter.tsx +++ b/src/components/Note/NoteFooter/NoteFooter.tsx @@ -79,6 +79,10 @@ const NoteFooter: Component<{ note: PrimalNote, doCustomZap?: boolean, id?: stri }; const doQuote = () => { + if (!account?.hasPublicKey()) { + account?.actions.showGetStarted(); + return; + } setIsRepostMenuVisible(false); account?.actions?.quoteNote(`nostr:${props.note.post.noteId}`); account?.actions?.showNewNoteForm(); @@ -89,6 +93,11 @@ const NoteFooter: Component<{ note: PrimalNote, doCustomZap?: boolean, id?: stri return; } + if (!account.hasPublicKey()) { + account.actions.showGetStarted(); + return; + } + if (account.relays.length === 0) { toast?.sendWarning( intl.formatMessage(t.noRelaysConnected), @@ -124,6 +133,11 @@ const NoteFooter: Component<{ note: PrimalNote, doCustomZap?: boolean, id?: stri return; } + if (!account.hasPublicKey()) { + account.actions.showGetStarted(); + return; + } + if (account.relays.length === 0) { toast?.sendWarning( intl.formatMessage(t.noRelaysConnected), @@ -148,9 +162,10 @@ const NoteFooter: Component<{ note: PrimalNote, doCustomZap?: boolean, id?: stri e.stopPropagation(); if (!account?.hasPublicKey()) { - toast?.sendWarning( - intl.formatMessage(t.zapAsGuest), - ); + account?.actions.showGetStarted() + // toast?.sendWarning( + // intl.formatMessage(t.zapAsGuest), + // ); setIsZapping(false); return; } @@ -182,7 +197,12 @@ const NoteFooter: Component<{ note: PrimalNote, doCustomZap?: boolean, id?: stri clearTimeout(quickZapDelay); - if (!account?.hasPublicKey() || account.relays.length === 0 || !canUserReceiveZaps(props.note.user)) { + if (!account?.hasPublicKey()) { + account?.actions.showGetStarted(); + return; + } + + if (account.relays.length === 0 || !canUserReceiveZaps(props.note.user)) { return; } @@ -278,22 +298,24 @@ const NoteFooter: Component<{ note: PrimalNote, doCustomZap?: boolean, id?: stri } const doQuickZap = async () => { - - if (account?.hasPublicKey()) { - setZappedAmount(() => settings?.defaultZapAmount || 0); - setZappedNow(true); - animateZap(); - const success = await zapNote(props.note, account.publicKey, settings?.defaultZapAmount || 10, '', account.relays); - setIsZapping(false); - - if (success) { - return; - } - - setZappedAmount(() => -(settings?.defaultZapAmount || 0)); - setZappedNow(true); - setZapped(props.note.post.noteActions.zapped); + if (!account?.hasPublicKey()) { + account?.actions.showGetStarted(); + return; } + + setZappedAmount(() => settings?.defaultZapAmount || 0); + setZappedNow(true); + animateZap(); + const success = await zapNote(props.note, account.publicKey, settings?.defaultZapAmount || 10, '', account.relays); + setIsZapping(false); + + if (success) { + return; + } + + setZappedAmount(() => -(settings?.defaultZapAmount || 0)); + setZappedNow(true); + setZapped(props.note.post.noteActions.zapped); } const buttonTypeClasses: Record = {