diff --git a/src/components/voting/VoteResultsPanel.tsx b/src/components/voting/VoteResultsPanel.tsx index 5ed15629..bb89ec16 100644 --- a/src/components/voting/VoteResultsPanel.tsx +++ b/src/components/voting/VoteResultsPanel.tsx @@ -36,12 +36,14 @@ export const VoteResultsPanel = ({ const theme = useMantineTheme(); const consolidated = useMemo(() => { - if (!ships || !userVotes || !contest) return []; + if (!ships || !contest) return []; return ships.map((ship) => { const shipChoice = contest?.choices.find((c) => c.shipId === ship.id); - const userVote = userVotes.find((v) => v.choice_id === shipChoice?.id); + const userVote = userVotes + ? userVotes.find((v) => v.choice_id === shipChoice?.id) + : null; return { ...ship, vote: userVote, choice: shipChoice }; }); @@ -100,7 +102,11 @@ export const VoteResultsPanel = ({ )} - {hasUserVoted ? 'Your vote has been submitted!' : 'Voting is Complete!'} + {hasUserVoted + ? 'Your vote has been submitted!' + : isPeeking + ? 'Voting Results so far' + : 'Voting is Complete!'} {hasUserVoted && ( diff --git a/src/constants/addresses.ts b/src/constants/addresses.ts index 8c317ede..db204c18 100644 --- a/src/constants/addresses.ts +++ b/src/constants/addresses.ts @@ -8,7 +8,7 @@ export const ADDR_TESTNET: Record = { GM_FACTORY: '0x14e32E7893D6A1fA5f852d8B2fE8c57A2aB670ba', GS_FACTORY: '0x8D994BEef251e30C858e44eCE3670feb998CA77a', HATS_POSTER: '0x4F0dc1C7d91d914d921F3C9C188F4454AE260317', - VOTE_CONTEST: '0x3d06D95026696826B507D25cfBb86E4457F34eC5', + VOTE_CONTEST: '0xB60D9C91aBcA9d32a2a543BDFF958Db2d7DFb816', } as const; export const ADDR_PROD: Record = { diff --git a/src/pages/Vote.tsx b/src/pages/Vote.tsx index e460a233..dd1f9c6f 100644 --- a/src/pages/Vote.tsx +++ b/src/pages/Vote.tsx @@ -153,6 +153,8 @@ const VotingOpen = ({ validateInputOnBlur: true, }); + const { votingStage } = useVoting(); + const [step, setStep] = useState(0); const [modalOpen, setModalOpen] = useState(false); @@ -205,16 +207,18 @@ const VotingOpen = ({ - - setSeeResults(true)} - > - - - + {votingStage === VotingStage.Active && ( + + setSeeResults(true)} + > + + + + )}