fix: Deal with questions with no options

Like https://metaforecast.org/questions/metaculus-6326
This commit is contained in:
NunoSempere 2022-05-20 14:37:40 -04:00
parent 020f0c0c5e
commit 40c6f57c11

View File

@ -91,17 +91,19 @@ const LargeQuestionCard: React.FC<{
</div>
<div className="mb-10">
{question.platform.id === "guesstimate" && question.visualization ? (
<a className="no-underline" href={question.url} target="_blank">
<img
className="rounded-sm"
src={question.visualization}
alt="Guesstimate Screenshot"
/>
</a>
) : (
<HistoryChart question={question} />
)}
{
question.platform.id === "guesstimate" && question.visualization ? (
<a className="no-underline" href={question.url} target="_blank">
<img
className="rounded-sm"
src={question.visualization}
alt="Guesstimate Screenshot"
/>
</a>
) : question.options.length > 0 ? (
<HistoryChart question={question} />
) : null /* Don't display chart if there are no options, for now. */
}
</div>
<div className="mx-auto max-w-prose">