From 014d76423b39c7b3285a0655ce27ddeb20a8fb8c Mon Sep 17 00:00:00 2001 From: ctrlc03 <93448202+ctrlc03@users.noreply.github.com> Date: Fri, 30 Aug 2024 10:44:31 +0100 Subject: [PATCH] fix: ensure project 0 can be used --- .../src/features/ballot/components/SubmitBallotButton.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/interface/src/features/ballot/components/SubmitBallotButton.tsx b/packages/interface/src/features/ballot/components/SubmitBallotButton.tsx index aff8d5d..aac7389 100644 --- a/packages/interface/src/features/ballot/components/SubmitBallotButton.tsx +++ b/packages/interface/src/features/ballot/components/SubmitBallotButton.tsx @@ -27,7 +27,8 @@ export const SubmitBallotButton = (): JSX.Element => { const handleSubmitBallot = useCallback(async () => { const votes = ballot.votes.map(({ amount, projectId }) => { const index = projectIndices[projectId]; - if (!index) { + + if (index === -1 || index === undefined) { throw new Error("There are some problems due to project index mapping."); }