Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
fix: overflow turnout, results
Browse files Browse the repository at this point in the history
  • Loading branch information
tassiluca committed Jan 31, 2024
1 parent c07316e commit 04bd70a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/views/ElectionDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ onMounted(async () => {
if (election.value) {
election.value = {
...election.value, // Shallow copy of the original object
turnout: turnout,
turnout: `${parseFloat(turnout.replace('%', '')).toFixed(2)}%`,
};
}
});
Expand Down Expand Up @@ -81,7 +81,7 @@ async function getVotingDetails(id: string) {
<div class="col">
<Tile title="Results">
<template #default>
<p v-if="Object.keys(election.results).length === 0 && Date.now() < election.start.getTime()">
<p v-if="Object.keys(election.results).length !== 0 && highestOf(election.results)[0].value === 0 && Date.now() < election.start.getTime()">
Voting has not been opened, yet.
</p>
<p v-else-if="Object.keys(election.results).length === 0">
Expand Down

0 comments on commit 04bd70a

Please sign in to comment.