From 65301a1bc9491c6708286bba7b3bc1bb88752246 Mon Sep 17 00:00:00 2001 From: David Robert-Ansart Date: Sun, 15 Dec 2024 21:26:22 +0100 Subject: [PATCH] Fix content value missing --- src/pages/contenu-libre/2.tsx | 2 +- src/pages/contenu-libre/3.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/contenu-libre/2.tsx b/src/pages/contenu-libre/2.tsx index 42bdebb0a..b98a90b43 100644 --- a/src/pages/contenu-libre/2.tsx +++ b/src/pages/contenu-libre/2.tsx @@ -31,7 +31,7 @@ const ContenuLibre = () => { const data = (activity?.data as FreeContentData) || null; const errorSteps = React.useMemo(() => { - if (activity !== null && activity.content.filter((c) => c.value?.length > 0 && c.value !== '

\n').length === 0) { + if (activity !== null && activity.content.filter((c) => c.value && c.value.length > 0 && c.value !== '

\n').length === 0) { return [0]; } return []; diff --git a/src/pages/contenu-libre/3.tsx b/src/pages/contenu-libre/3.tsx index f7e8902eb..b1d53264a 100644 --- a/src/pages/contenu-libre/3.tsx +++ b/src/pages/contenu-libre/3.tsx @@ -30,7 +30,7 @@ const ContenuLibre = () => { const errorSteps = React.useMemo(() => { const errors: number[] = []; const data = (activity?.data as FreeContentData) || null; - if (activity !== null && activity.content.filter((c) => c.value?.length > 0 && c.value !== '

\n').length === 0) { + if (activity !== null && activity.content.filter((c) => c.value && c.value.length > 0 && c.value !== '

\n').length === 0) { errors.push(0); } if (data !== null && (!data.title || !data.resume)) {