From bafe19240a1defd2501cc73627a3ddc7bc1dfed7 Mon Sep 17 00:00:00 2001 From: yu-zhen Date: Mon, 2 Sep 2024 15:17:05 +0900 Subject: [PATCH] fix: stepComplete is still false if add contribution links or funding source --- .../components/ApplicationButtons.tsx | 21 ++++--------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/packages/interface/src/features/applications/components/ApplicationButtons.tsx b/packages/interface/src/features/applications/components/ApplicationButtons.tsx index bfff33d3..5701ec5b 100644 --- a/packages/interface/src/features/applications/components/ApplicationButtons.tsx +++ b/packages/interface/src/features/applications/components/ApplicationButtons.tsx @@ -74,7 +74,7 @@ export const ApplicationButtons = ({ ): boolean => links === undefined || links.every((link) => link.description !== undefined && link.description.length > 0); - const stepComplete = useMemo((): boolean => { + const checkStepComplete = (): boolean => { if (step === EApplicationStep.PROFILE) { return ( bannerImageUrl !== undefined && @@ -98,32 +98,19 @@ export const ApplicationButtons = ({ } return true; - }, [ - step, - bannerImageUrl, - profileImageUrl, - bio, - name, - payoutAddress, - websiteUrl, - impactCategory, - contributionDescription, - impactDescription, - contributionLinks, - fundingSources, - ]); + }; const handleOnClickNextStep = useCallback( (event: UIEvent) => { event.preventDefault(); - if (stepComplete) { + if (checkStepComplete()) { onNextStep(); } else { setShowDialog(true); } }, - [onNextStep, setShowDialog, stepComplete], + [onNextStep, setShowDialog, checkStepComplete], ); const handleOnClickBackStep = useCallback(