Skip to content

Commit

Permalink
Fix content value missing
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidRobertAnsart committed Dec 15, 2024
1 parent 3127696 commit 65301a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pages/contenu-libre/2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 !== '<p></p>\n').length === 0) {
if (activity !== null && activity.content.filter((c) => c.value && c.value.length > 0 && c.value !== '<p></p>\n').length === 0) {
return [0];
}
return [];
Expand Down
2 changes: 1 addition & 1 deletion src/pages/contenu-libre/3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 !== '<p></p>\n').length === 0) {
if (activity !== null && activity.content.filter((c) => c.value && c.value.length > 0 && c.value !== '<p></p>\n').length === 0) {
errors.push(0);
}
if (data !== null && (!data.title || !data.resume)) {
Expand Down

0 comments on commit 65301a1

Please sign in to comment.