From 916bd8387b9ceabd566c4ede0d75af17262eea4e Mon Sep 17 00:00:00 2001 From: MTG2000 Date: Thu, 4 Aug 2022 18:56:12 +0300 Subject: [PATCH] fix: make lightning-address in profile optional, fixing a bug when confirming comment --- .../Components/Comments/CommentsSection/useComments.tsx | 6 +++--- .../pages/ProfilePage/AboutCard/UpdateAboutForm.tsx | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/features/Posts/Components/Comments/CommentsSection/useComments.tsx b/src/features/Posts/Components/Comments/CommentsSection/useComments.tsx index 73eb220..6988a94 100644 --- a/src/features/Posts/Components/Comments/CommentsSection/useComments.tsx +++ b/src/features/Posts/Components/Comments/CommentsSection/useComments.tsx @@ -166,7 +166,7 @@ async function signEvent(event: any) { } async function confirmPublishingEvent(event: any) { - const res = await fetch(CONSTS.apiEndpoint + '/nostr-confirm-event', { + await fetch(CONSTS.apiEndpoint + '/nostr-confirm-event', { method: "post", body: JSON.stringify({ event }), credentials: 'include', @@ -174,8 +174,8 @@ async function confirmPublishingEvent(event: any) { 'Content-Type': 'application/json' }, }); - const data = await res.json() - return data.event; + + } diff --git a/src/features/Profiles/pages/ProfilePage/AboutCard/UpdateAboutForm.tsx b/src/features/Profiles/pages/ProfilePage/AboutCard/UpdateAboutForm.tsx index 17a2b8d..c01cadf 100644 --- a/src/features/Profiles/pages/ProfilePage/AboutCard/UpdateAboutForm.tsx +++ b/src/features/Profiles/pages/ProfilePage/AboutCard/UpdateAboutForm.tsx @@ -33,7 +33,7 @@ const schema: yup.SchemaOf = yup.object({ const res = await fetch(lnurl); if (res.status === 200) return true; } - return false; + return true; } catch (error) { return false; } @@ -227,6 +227,7 @@ export default function UpdateAboutForm({ data, onClose }: Props) {

Lightning address

+
{errors.lightning_address.message}

} +

+ Your lightning address is used to send the votes you get on your posts, comments, apps...etc, directly to you. +