From 9c9b32886050fa12939ed35f1b5789f12763984d Mon Sep 17 00:00:00 2001 From: James Grugett Date: Wed, 16 Feb 2022 15:04:31 -0600 Subject: [PATCH] Fix card showing 0% for multi contracts --- web/components/answers-panel.tsx | 2 +- web/components/contract-card.tsx | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/web/components/answers-panel.tsx b/web/components/answers-panel.tsx index c269adcb..277e9ccd 100644 --- a/web/components/answers-panel.tsx +++ b/web/components/answers-panel.tsx @@ -111,7 +111,7 @@ function AnswerItem(props: { return ( @@ -67,7 +66,8 @@ export function ResolutionOrChance(props: { className?: string }) { const { contract, large, className } = props - const { resolution } = contract + const { resolution, outcomeType } = contract + const isBinary = outcomeType === 'BINARY' const marketClosed = (contract.closeTime || Infinity) < Date.now() const resolutionColor = @@ -102,12 +102,14 @@ export function ResolutionOrChance(props: {
{resolutionText}
) : ( - <> -
{getBinaryProbPercent(contract)}
-
- chance -
- + isBinary && ( + <> +
{getBinaryProbPercent(contract)}
+
+ chance +
+ + ) )} )