From 37f6389d8edfa3a45ad5fecd1deea1e43845c3c3 Mon Sep 17 00:00:00 2001 From: colinmfoster4723 Date: Wed, 6 Nov 2024 17:14:42 -0600 Subject: [PATCH] Added required field check --- ui/components/subscription/CitizenMetadataModal.tsx | 9 +++++++++ ui/components/subscription/TeamMetadataModal.tsx | 11 ++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ui/components/subscription/CitizenMetadataModal.tsx b/ui/components/subscription/CitizenMetadataModal.tsx index b28ecd95..2fdaec11 100644 --- a/ui/components/subscription/CitizenMetadataModal.tsx +++ b/ui/components/subscription/CitizenMetadataModal.tsx @@ -236,6 +236,15 @@ export default function CitizenMetadataModal({ requiredChain={DEFAULT_CHAIN} label="Submit" action={async () => { + if ( + !citizenData.name || + citizenData.name.trim() === '' || + !citizenData.description || + citizenData.description.trim() === '' + ) { + return toast.error('Please enter a name and bio.') + } + const accessToken = await getAccessToken() await createSession(accessToken) try { diff --git a/ui/components/subscription/TeamMetadataModal.tsx b/ui/components/subscription/TeamMetadataModal.tsx index 8c5f9b49..096aa120 100644 --- a/ui/components/subscription/TeamMetadataModal.tsx +++ b/ui/components/subscription/TeamMetadataModal.tsx @@ -10,7 +10,6 @@ import { pinBlobOrFile } from '@/lib/ipfs/pinBlobOrFile' import { unpin } from '@/lib/ipfs/unpin' import { createSession, destroySession } from '@/lib/iron-session/iron-session' import cleanData from '@/lib/tableland/cleanData' -import useTeamEmail from '@/lib/team/useTeamEmail' import deleteResponse from '@/lib/typeform/deleteResponse' import waitForResponse from '@/lib/typeform/waitForResponse' import { renameFile } from '@/lib/utils/files' @@ -161,6 +160,7 @@ export default function TeamMetadataModal({

Update Info