Skip to content

Commit

Permalink
Forbid changing the selection while voting
Browse files Browse the repository at this point in the history
  • Loading branch information
csillag committed Sep 23, 2024
1 parent 6e1a220 commit b9908cb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/src/pages/PollPage/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand All @@ -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)
Expand Down

0 comments on commit b9908cb

Please sign in to comment.