diff --git a/src/modules/question-view/QuestionView.tsx b/src/modules/question-view/QuestionView.tsx index f83b7f4d..95dbeda8 100644 --- a/src/modules/question-view/QuestionView.tsx +++ b/src/modules/question-view/QuestionView.tsx @@ -47,7 +47,7 @@ const QuestionView = (): JSX.Element => { } = useUserAnswers(); const [answer, setAnswer] = useState(''); - const [isInit, setIsInit] = useState(false); + // const [isInit, setIsInit] = useState(false); const userAuthentified = useMemo( () => typeof memberId === 'string' && memberId.length > 0, @@ -56,11 +56,10 @@ const QuestionView = (): JSX.Element => { // Update the answer if the stored value change useEffect(() => { - if (!isInit && status === 'success' && answer.length === 0) { + if (status === 'success' && answer.length === 0) { setAnswer(userAnswer?.answer ?? ''); - setIsInit(true); } - }, [answer.length, isInit, status, userAnswer]); + }, [answer.length, status, userAnswer]); const answerStatus = useMemo(() => userAnswer?.status, [userAnswer?.status]); const showSubmitButton = useMemo(