From 6a02d6556a6a2ebcc4089e71e571f22c763ef0e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rialland?= Date: Thu, 6 Apr 2023 15:59:54 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20stats=20simulation=20termin=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/source/components/conversation/Conversation.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/site/source/components/conversation/Conversation.tsx b/site/source/components/conversation/Conversation.tsx index 9ad0718b3..9f7f003b6 100644 --- a/site/source/components/conversation/Conversation.tsx +++ b/site/source/components/conversation/Conversation.tsx @@ -1,6 +1,6 @@ import { DottedName } from 'modele-social' import Engine, { PublicodesExpression } from 'publicodes' -import React from 'react' +import React, { useEffect, useState } from 'react' import { Trans, useTranslation } from 'react-i18next' import { useDispatch, useSelector } from 'react-redux' @@ -60,6 +60,9 @@ export default function Conversation({ dispatch(answerQuestion(dottedName, value)) } + const [firstRenderDone, setFirstRenderDone] = useState(false) + useEffect(() => setFirstRenderDone(true), []) + return ( <>
@@ -161,7 +164,7 @@ export default function Conversation({ ) : (
- + {firstRenderDone && }

{' '}