Skip to content

Commit

Permalink
refactor: improve code reading
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e committed Dec 11, 2024
1 parent ab7820b commit 24cf638
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions apps/ui/src/composables/useVotingPower.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ export function useVotingPower() {
}

function getProposalSnapshot(proposal: Proposal): number | null {
return (
(proposal.state === 'pending' &&
const snapshot =
proposal.state === 'pending' &&
!offchainNetworks.includes(proposal.network)
? null
: proposal.snapshot) || getLatestBlock(proposal.network)
);
: proposal.snapshot;

return snapshot || getLatestBlock(proposal.network);
}

function getSnapshot(
Expand Down

0 comments on commit 24cf638

Please sign in to comment.