Skip to content

Commit

Permalink
Merge pull request #885 from parlemonde/fix-LanguageDefi-title
Browse files Browse the repository at this point in the history
Fix language defi title
  • Loading branch information
MelissaOlas authored Mar 4, 2024
2 parents 47850fa + c0bd338 commit 9176ffa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/activity-types/defi.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/lancer-un-defi/linguistique/2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) : "<langue choisie à l'étape 1>",
language: data.languageCode && data.languageCode.length > 0 ? capitalize(data.language) : "(langue non choisie à l'étape 1)",
})}
onClick={onClick(index)}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/lancer-un-defi/linguistique/4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
Expand Down

0 comments on commit 9176ffa

Please sign in to comment.