From 36c350eb9ccc01c8094f0e503110f67a6e1df8dc Mon Sep 17 00:00:00 2001 From: solimander Date: Fri, 3 Nov 2023 09:33:30 -0600 Subject: [PATCH] Use block - 1 --- packages/nouns-webapp/src/components/ProposalHeader/index.tsx | 2 +- packages/nouns-webapp/src/pages/Vote/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nouns-webapp/src/components/ProposalHeader/index.tsx b/packages/nouns-webapp/src/components/ProposalHeader/index.tsx index 7b6b3cd589..f742102ad3 100644 --- a/packages/nouns-webapp/src/components/ProposalHeader/index.tsx +++ b/packages/nouns-webapp/src/components/ProposalHeader/index.tsx @@ -68,7 +68,7 @@ const ProposalHeader: React.FC = props => { const isMobile = isMobileScreen(); const currentBlock = useBlockNumber(); const currentOrSnapshotBlock = useMemo(() => - Math.min(proposal?.voteSnapshotBlock, currentBlock ?? 0) || undefined, + Math.min(proposal?.voteSnapshotBlock, (currentBlock ? currentBlock - 1 : 0)) || undefined, [proposal, currentBlock] ); const availableVotes = useUserVotesAsOfBlock(currentOrSnapshotBlock) ?? 0; diff --git a/packages/nouns-webapp/src/pages/Vote/index.tsx b/packages/nouns-webapp/src/pages/Vote/index.tsx index fc7527d569..b51f77ffd5 100644 --- a/packages/nouns-webapp/src/pages/Vote/index.tsx +++ b/packages/nouns-webapp/src/pages/Vote/index.tsx @@ -162,7 +162,7 @@ const VotePage = ({ // Use user votes as of the current or proposal snapshot block const currentOrSnapshotBlock = useMemo(() => - Math.min(proposal?.voteSnapshotBlock ?? 0, currentBlock ?? 0) || undefined, + Math.min(proposal?.voteSnapshotBlock ?? 0, (currentBlock ? currentBlock - 1 : 0)) || undefined, [proposal, currentBlock] ); const userVotes = useUserVotesAsOfBlock(currentOrSnapshotBlock);