diff --git a/src/activity-types/defi.constants.ts b/src/activity-types/defi.constants.ts index 72ad0cdfa..57effdb1a 100644 --- a/src/activity-types/defi.constants.ts +++ b/src/activity-types/defi.constants.ts @@ -109,10 +109,10 @@ export const getDefi = (subtype: number, data: CookingDefiData | EcoDefiData | L return data.defiIndex === -1 && data.defi ? data.defi : ECO_DEFIS[(data.defiIndex ?? 0) % ECO_DEFIS.length].title; } if (subtype === DEFI.LANGUAGE && 'language' in data && 'themeIndex' in data) { - const defi = data.defiIndex !== null ? LANGUAGE_DEFIS[data.defiIndex].title : ''; + const defi = data.defiIndex !== null ? LANGUAGE_DEFIS[data.defiIndex].title : data.defi ? data.defi : ''; return replaceTokens(defi, { - theme: data.themeIndex !== null ? LANGUAGE_THEMES[data.themeIndex].title2.toLowerCase() : "< thème choisi à l'étape 2 >", - language: data.languageCode.length > 0 ? data.languageCode : "< langue choisie à l'étape 1 >", + theme: data.themeIndex !== null ? LANGUAGE_THEMES[data.themeIndex].title2.toLowerCase() : data.themeName, + language: data.languageCode.length > 0 ? data.language : "(langue non choisie à l'étape 1)", }); } if (subtype === DEFI.FREE) { diff --git a/src/pages/lancer-un-defi/linguistique/2.tsx b/src/pages/lancer-un-defi/linguistique/2.tsx index dd6537c44..3004b6c93 100644 --- a/src/pages/lancer-un-defi/linguistique/2.tsx +++ b/src/pages/lancer-un-defi/linguistique/2.tsx @@ -75,7 +75,7 @@ const DefiStep2 = () => { key={index} label={l.title} description={replaceTokens(l.desc1, { - language: data.languageCode && data.languageCode.length > 0 ? capitalize(data.language) : "", + language: data.languageCode && data.languageCode.length > 0 ? capitalize(data.language) : "(langue non choisie à l'étape 1)", })} onClick={onClick(index)} /> diff --git a/src/pages/lancer-un-defi/linguistique/4.tsx b/src/pages/lancer-un-defi/linguistique/4.tsx index c0844cf10..cff4786aa 100644 --- a/src/pages/lancer-un-defi/linguistique/4.tsx +++ b/src/pages/lancer-un-defi/linguistique/4.tsx @@ -94,8 +94,8 @@ const DefiStep4 = () => { label={replaceTokens(t.title, { theme: data.hasSelectedThemeNameOther ? data.themeName - : (data.themeIndex !== null && LANGUAGE_THEMES[data.themeIndex].title.toLowerCase()) || " < thème choisi à l'étape 2 > ", - language: data.languageCode && data.languageCode.length > 0 ? capitalize(data.language) : "< langue choisie à l'étape 1 > ", + : (data.themeIndex !== null && LANGUAGE_THEMES[data.themeIndex].title.toLowerCase()) || data.themeName, + language: data.languageCode && data.languageCode.length > 0 ? capitalize(data.language) : "(langue non choisie à l'étape 1)", })} description={t.description} onClick={onClick(index)}