Fix hiding answers where all bets sold
This commit is contained in:
parent
858ce10b49
commit
8fe9f23d91
|
@ -15,11 +15,13 @@ import { AnswerResolvePanel } from './answer-resolve-panel'
|
||||||
|
|
||||||
export function AnswersPanel(props: { contract: Contract; answers: Answer[] }) {
|
export function AnswersPanel(props: { contract: Contract; answers: Answer[] }) {
|
||||||
const { contract } = props
|
const { contract } = props
|
||||||
const { creatorId, resolution, resolutions, pool } = contract
|
const { creatorId, resolution, resolutions, totalBets } = contract
|
||||||
|
|
||||||
const answers = useAnswers(contract.id) ?? props.answers
|
const answers = useAnswers(contract.id) ?? props.answers
|
||||||
const [winningAnswers, otherAnswers] = _.partition(
|
const [winningAnswers, otherAnswers] = _.partition(
|
||||||
answers.filter((answer) => answer.id !== '0' && pool[answer.id] > 0),
|
answers.filter(
|
||||||
|
(answer) => answer.id !== '0' && totalBets[answer.id] > 0.000000001
|
||||||
|
),
|
||||||
(answer) =>
|
(answer) =>
|
||||||
answer.id === resolution || (resolutions && resolutions[answer.id])
|
answer.id === resolution || (resolutions && resolutions[answer.id])
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user