Skip to content

Commit

Permalink
fix: 🐛 Fix total display
Browse files Browse the repository at this point in the history
  • Loading branch information
chef-ryan committed Jan 7, 2025
1 parent 8969434 commit 0db0e3e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/web/src/views/Voting/CreateProposal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
useToast,
useTooltip,
} from '@pancakeswap/uikit'
import { formatNumber } from '@pancakeswap/utils/formatNumber'
import truncateHash from '@pancakeswap/utils/truncateHash'
import snapshot from '@snapshot-labs/snapshot.js'
import ConnectWalletButton from 'components/ConnectWalletButton'
Expand Down Expand Up @@ -91,7 +92,6 @@ const CreateProposal = () => {
})

const { total, isLoading } = useGetVotingPower(watch('snapshot'))
console.log(total)
const enoughVotingPower = total >= VOTE_THRESHOLD

const {
Expand Down Expand Up @@ -361,7 +361,9 @@ const CreateProposal = () => {
{t('Voting Power')}
</Text>
<Box ml="8px">
<TooltipText ref={votingPowerTargetRef}>{isLoading ? '-' : total ?? 0}</TooltipText>
<TooltipText ref={votingPowerTargetRef}>
{isLoading ? '-' : formatNumber(total ?? 0, { maxDecimalDisplayDigits: 2 })}
</TooltipText>
{votingPowerTooltipVisible && votingPowerTooltip}
</Box>
</Flex>
Expand Down

0 comments on commit 0db0e3e

Please sign in to comment.