Skip to content

Commit

Permalink
Use block - 1
Browse files Browse the repository at this point in the history
  • Loading branch information
solimander committed Nov 3, 2023
1 parent 20b0b9a commit 36c350e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const ProposalHeader: React.FC<ProposalHeaderProps> = 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;
Expand Down
2 changes: 1 addition & 1 deletion packages/nouns-webapp/src/pages/Vote/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 36c350e

Please sign in to comment.