Skip to content

Commit cdccc7f

Browse files
committed
fix(VotesAllocation&VotingPower): zero votes
1 parent 7dd2ab8 commit cdccc7f

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

components/modules/proposal/VotesAllocation.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,16 @@ const expand = ref(["inactive", "active"].includes(props.proposal.status))
112112
<Flex v-for="vote in votes" align="center" justify="between">
113113
<Flex align="center" gap="6">
114114
<div :class="[$style.dot, $style[vote]]" />
115-
<Text size="12" weight="600" color="secondary" style="text-transform: capitalize">{{
116-
vote.replaceAll("_", " ")
117-
}}</Text>
115+
<Text size="12" weight="600" color="secondary" style="text-transform: capitalize">
116+
{{ vote.replaceAll("_", " ") }}
117+
</Text>
118118
<Text size="12" weight="600" color="tertiary">{{ comma(proposal[vote]) }}</Text>
119119
</Flex>
120120

121121
<Text size="12" weight="600" :color="proposal[vote] ? 'secondary' : 'tertiary'">
122-
<template v-if="(proposal[vote] * 100) / proposal.votes_count < 1">
122+
<template
123+
v-if="(proposal[vote] * 100) / proposal.votes_count > 0 && (proposal[vote] * 100) / proposal.votes_count < 1"
124+
>
123125
<Text color="tertiary">< 1%</Text>
124126
</template>
125127
<template v-else> {{ ((proposal[vote] * 100) / proposal.votes_count).toFixed(0) }}% </template>

components/modules/proposal/VotingPower.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ const expand = ref(["active"].includes(props.proposal.status))
118118
</Flex>
119119

120120
<Text size="12" weight="600" :color="proposal[vote] ? 'secondary' : 'tertiary'">
121-
<template v-if="(Number(proposal[`${vote}_voting_power`]) * 100) / (Number(proposal.voting_power) * 2) < 1">
121+
<template
122+
v-if="
123+
(Number(proposal[`${vote}_voting_power`]) * 100) / (Number(proposal.voting_power) * 2) > 0 &&
124+
(Number(proposal[`${vote}_voting_power`]) * 100) / (Number(proposal.voting_power) * 2) < 1
125+
"
126+
>
122127
<Text color="tertiary">< 1%</Text>
123128
</template>
124129
<template v-else>

0 commit comments

Comments
 (0)