Skip to content

Commit

Permalink
title fixed with condition if index null
Browse files Browse the repository at this point in the history
  • Loading branch information
MelissaOlas committed Mar 1, 2024
1 parent a942ece commit df53e48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 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 >",
language: data.languageCode.length > 0 ? data.language : "< langue choisie à l'étape 1 >",
});
}
if (subtype === DEFI.FREE) {
Expand Down

0 comments on commit df53e48

Please sign in to comment.