From 40c6f57c113f0bade4e07be37f78d526e9a14d83 Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Fri, 20 May 2022 14:37:40 -0400 Subject: [PATCH] fix: Deal with questions with no options Like https://metaforecast.org/questions/metaculus-6326 --- src/web/questions/pages/QuestionPage.tsx | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/web/questions/pages/QuestionPage.tsx b/src/web/questions/pages/QuestionPage.tsx index 0429c72..ea921a3 100644 --- a/src/web/questions/pages/QuestionPage.tsx +++ b/src/web/questions/pages/QuestionPage.tsx @@ -91,17 +91,19 @@ const LargeQuestionCard: React.FC<{
- {question.platform.id === "guesstimate" && question.visualization ? ( - - Guesstimate Screenshot - - ) : ( - - )} + { + question.platform.id === "guesstimate" && question.visualization ? ( + + Guesstimate Screenshot + + ) : question.options.length > 0 ? ( + + ) : null /* Don't display chart if there are no options, for now. */ + }