Skip to content

Commit 2a42609

Browse files
committed
fix: count votes
1 parent 6a14db0 commit 2a42609

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

plugins/maciVoting/contexts/MaciContext.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ export const MaciProvider = ({ children }: { children: ReactNode }) => {
237237
return;
238238
}
239239

240-
if (!stateIndex) {
241-
setError("State index not found");
240+
if (!pollStateIndex) {
241+
setError("Poll state index not found");
242242
setIsLoading(false);
243243
return;
244244
}
@@ -264,7 +264,7 @@ export const MaciProvider = ({ children }: { children: ReactNode }) => {
264264

265265
await publish({
266266
publicKey: maciKeypair.publicKey.serialize(),
267-
stateIndex: BigInt(stateIndex),
267+
stateIndex: BigInt(pollStateIndex),
268268
voteOptionIndex,
269269
nonce: 1n,
270270
pollId,
@@ -282,7 +282,7 @@ export const MaciProvider = ({ children }: { children: ReactNode }) => {
282282
type: "success",
283283
});
284284
},
285-
[addAlert, hasJoinedPoll, maciKeypair, pollId, signer, stateIndex]
285+
[addAlert, hasJoinedPoll, maciKeypair, pollId, signer, pollStateIndex]
286286
);
287287

288288
// check if user is connected

0 commit comments

Comments
 (0)