From a1b6a49d467c32c9c2773433720b967b7ab6d8ab Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Mon, 13 Jun 2022 09:25:49 -0600 Subject: [PATCH] Don't use bets to filter answers --- web/components/answers/answers-panel.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/web/components/answers/answers-panel.tsx b/web/components/answers/answers-panel.tsx index eb992fe4..b1cbd4b8 100644 --- a/web/components/answers/answers-panel.tsx +++ b/web/components/answers/answers-panel.tsx @@ -1,5 +1,5 @@ import { sortBy, partition, sum, uniq } from 'lodash' -import { useLayoutEffect, useState } from 'react' +import { useEffect, useState } from 'react' import { FreeResponseContract } from 'common/contract' import { Col } from '../layout/col' @@ -27,13 +27,11 @@ import { BuyButton } from 'web/components/yes-no-selector' export function AnswersPanel(props: { contract: FreeResponseContract }) { const { contract } = props - const { creatorId, resolution, resolutions, totalBets } = contract + const { creatorId, resolution, resolutions } = contract const answers = useAnswers(contract.id) ?? contract.answers const [winningAnswers, losingAnswers] = partition( - answers.filter( - (answer) => answer.id !== '0' && totalBets[answer.id] > 0.000000001 - ), + answers.filter((answer) => answer.id !== '0'), (answer) => answer.id === resolution || (resolutions && resolutions[answer.id]) ) @@ -85,7 +83,7 @@ export function AnswersPanel(props: { contract: FreeResponseContract }) { }) } - useLayoutEffect(() => { + useEffect(() => { setChosenAnswers({}) }, [resolveOption])