Skip to content

Commit

Permalink
Fix an issue in which “contested” status took priority over “win” or …
Browse files Browse the repository at this point in the history
…“lose” status
  • Loading branch information
kohlmannj committed Mar 3, 2022
1 parent 4e9e5cb commit e64242c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/vote-count/useVoteData.ts
Expand Up @@ -36,9 +36,9 @@ function getVoteStatus({
neededToWin,
}: Omit<VoteData, 'status'>): VoteStatus {
if (total === 0) return 'loading';
if (yes + no + contested === total && contested > 0) return 'contested';
if (yes >= neededToWin) return 'win';
if (no >= neededToWin) return 'loss';
if (yes + no + contested === total && contested > 0) return 'contested';
return 'beforeResult';
}

Expand Down

0 comments on commit e64242c

Please sign in to comment.