Skip to content

Commit

Permalink
fix: first turn vote (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
userMeh authored Jul 11, 2024
1 parent d0cbab2 commit 7626d56
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,12 @@ function ShowContent() {
</TabsList>
</div>
<TabsContent value={poll.id.toString()}>
{hasVoted.includes(poll.id) && <VotesResults poll={poll} round={poll.round} />}
{!hasVoted.includes(poll.id) && <VotesOptions poll={poll} hasVoted={setHasVoted} round={poll.round} />}
{(hasVoted.includes(poll.id) || new Date(poll.end_at) < new Date()) && (
<VotesResults poll={poll} round={poll.round} />
)}
{!hasVoted.includes(poll.id) && new Date(poll.end_at) > new Date() && (
<VotesOptions poll={poll} hasVoted={setHasVoted} round={poll.round} />
)}
</TabsContent>
{poll.sub_polls.map((subPoll) => (
<TabsContent key={subPoll.id} value={subPoll.id.toString()}>
Expand Down

0 comments on commit 7626d56

Please sign in to comment.