mirror of
https://github.com/PrimalHQ/primal-web-app.git
synced 2024-09-30 00:41:09 +00:00
Show "Get Started" on acctions that require account
This commit is contained in:
parent
79110494fe
commit
5e668f5c25
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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,8 +298,11 @@ const NoteFooter: Component<{ note: PrimalNote, doCustomZap?: boolean, id?: stri
|
||||
}
|
||||
|
||||
const doQuickZap = async () => {
|
||||
if (!account?.hasPublicKey()) {
|
||||
account?.actions.showGetStarted();
|
||||
return;
|
||||
}
|
||||
|
||||
if (account?.hasPublicKey()) {
|
||||
setZappedAmount(() => settings?.defaultZapAmount || 0);
|
||||
setZappedNow(true);
|
||||
animateZap();
|
||||
@ -294,7 +317,6 @@ const NoteFooter: Component<{ note: PrimalNote, doCustomZap?: boolean, id?: stri
|
||||
setZappedNow(true);
|
||||
setZapped(props.note.post.noteActions.zapped);
|
||||
}
|
||||
}
|
||||
|
||||
const buttonTypeClasses: Record<string, string> = {
|
||||
zap: styles.zapType,
|
||||
|
Loading…
Reference in New Issue
Block a user