Skip to content

Commit

Permalink
Hide vote menu when is multiprocess
Browse files Browse the repository at this point in the history
  • Loading branch information
selankon committed Oct 17, 2024
1 parent 8097d0d commit 9931ff1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/Process/Aside.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@ const ProcessAside = () => {
} = useElection()
const { isConnected } = useAccount()
const { env, clear } = useClient()

if (!election || !(election instanceof PublishedElection)) return null

const census: CensusMeta = dotobject(election?.meta || {}, 'census')

const isMultiProcess = !!election.get('multiprocess')
const renderVoteMenu =
voted ||
(voting && election?.electionType.anonymous) ||
(hasOverwriteEnabled(election) && isInCensus && votesLeft > 0 && voted)
!isMultiProcess &&
(voted ||
(voting && election?.electionType.anonymous) ||
(hasOverwriteEnabled(election) && isInCensus && votesLeft > 0 && voted))

const showVoters =
election?.status !== ElectionStatus.CANCELED &&
Expand Down

0 comments on commit 9931ff1

Please sign in to comment.