Skip to content

Commit

Permalink
Fix null
Browse files Browse the repository at this point in the history
  • Loading branch information
selankon committed Oct 29, 2024
1 parent 8fc54f9 commit df32b57
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const QuestionsFormProvider: React.FC<
return (
<FormProvider {...fmethods}>
<QuestionsFormContext.Provider
value={{ fmethods, renderWith: props.renderWith, validate: props.validate, ...multiElections }}
value={{ fmethods, renderWith: props.renderWith ?? [], validate: props.validate, ...multiElections }}
>
{children}
</QuestionsFormContext.Provider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const ElectionQuestionsForm = ({ formId, onSubmit, onInvalid, ...rest }:
<chakra.div __css={styles.elections}>
<MultiElectionVoted />
<ElectionQuestion isDisabled={isDisabled} {...rest} />
{renderWith?.length > 0 &&
{renderWith?.length &&
renderWith.map(({ id }) => (
<ElectionProvider key={id} ConnectButton={ConnectButton} id={id} fetchCensus>
<SubElectionQuestions {...rest} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const MultiElectionVoted = () => {
return null
}
const votes = Object.values(elections).map((e) => e.voted)
return <VotedLogic votes={votes} />
return <VotedLogic votes={votes ?? []} />
}

export const Voted = () => {
Expand Down

0 comments on commit df32b57

Please sign in to comment.