From 875a2c418b095e95c6b43e3cc10fd8a0aea32aea Mon Sep 17 00:00:00 2001 From: ctrlc03 <93448202+ctrlc03@users.noreply.github.com> Date: Fri, 30 Aug 2024 10:48:10 +0100 Subject: [PATCH] fix: ensure project 0 can be used (#21) --- .../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."); }