From b9908cbffa46a35c5c7b75029f95737bf1451e2e Mon Sep 17 00:00:00 2001 From: Kristof Csillag Date: Tue, 24 Sep 2024 01:02:13 +0200 Subject: [PATCH] Forbid changing the selection while voting --- frontend/src/pages/PollPage/hook.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/PollPage/hook.ts b/frontend/src/pages/PollPage/hook.ts index 77e4a46..8a90855 100644 --- a/frontend/src/pages/PollPage/hook.ts +++ b/frontend/src/pages/PollPage/hook.ts @@ -82,7 +82,8 @@ export const usePollData = (pollId: string) => { canSelect = !remainingTime?.isPastDue && winningChoice === undefined && - (eth.state.address === undefined || existingVote === undefined) + (eth.state.address === undefined || existingVote === undefined) && + !isVoting canVote = (!!eth.state.address || isDemo) && @@ -100,7 +101,8 @@ export const usePollData = (pollId: string) => { !isCompleting && winningChoice === undefined && existingVote === undefined && - getVerdict(permissions.canVote, false) + getVerdict(permissions.canVote, false) && + !isVoting } const hasWallet = isDemo || (isHomeChain && userAddress !== ZeroAddress)