From bb984a6f63d1f7e49ab687f792d61fbf6cf36a55 Mon Sep 17 00:00:00 2001 From: Wan Qi Chen <495709+wa0x6e@users.noreply.github.com> Date: Fri, 25 Oct 2024 00:26:16 +0400 Subject: [PATCH] fix: offchain pending proposal should use the proposal snapshot --- apps/ui/src/composables/useVoteVotingPower.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/ui/src/composables/useVoteVotingPower.ts b/apps/ui/src/composables/useVoteVotingPower.ts index b8c3e5d65..f99d5982c 100644 --- a/apps/ui/src/composables/useVoteVotingPower.ts +++ b/apps/ui/src/composables/useVoteVotingPower.ts @@ -1,4 +1,4 @@ -import { supportsNullCurrent } from '@/networks'; +import { offchainNetworks, supportsNullCurrent } from '@/networks'; import { getIndex } from '@/stores/votingPowers'; import { NetworkID, Proposal, Space } from '@/types'; @@ -13,8 +13,10 @@ export function useVoteVotingPower() { function proposalSnapshot(proposal: Proposal) { return ( - (proposal.state === 'pending' ? null : proposal.snapshot) || - latestBlock(proposal.network) + (proposal.state === 'pending' && + !offchainNetworks.includes(proposal.network) + ? null + : proposal.snapshot) || latestBlock(proposal.network) ); }