Skip to content

Commit

Permalink
fix: stepComplete is still false if add contribution links or funding…
Browse files Browse the repository at this point in the history
… source
  • Loading branch information
kittybest committed Sep 2, 2024
1 parent 1542707 commit a1cecb9
Showing 1 changed file with 4 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand All @@ -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(
Expand Down

0 comments on commit a1cecb9

Please sign in to comment.