Skip to content

Commit

Permalink
fix: add skys fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mezotv committed Oct 27, 2024
1 parent 9823bee commit 785e777
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/util/Functions/jsonImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,14 @@ export async function getQuestionsByType(
const mixedQuestions = shuffle([...questionDatabase.concat(newRandomCustomQuestion[0])]);

result = {
id: mixedQuestions[0].id,
question:
normalizedLanguage === "en"
? mixedQuestions[0].question || mixedQuestions[0].question
: mixedQuestions[0].question || mixedQuestions[0].translations[normalizedLanguage],
id: mixedQuestions[0] ? mixedQuestions[0]?.id : mixedQuestions[1]?.id,
question: mixedQuestions[0]
? normalizedLanguage === "en"
? mixedQuestions[0]?.question || mixedQuestions[0]?.question
: mixedQuestions[0]?.question || mixedQuestions[0]?.translations[normalizedLanguage]
: normalizedLanguage === "en"
? mixedQuestions[1]?.question || mixedQuestions[1]?.question
: mixedQuestions[1]?.question || mixedQuestions[1]?.translations[normalizedLanguage],
};
break;
}
Expand Down

0 comments on commit 785e777

Please sign in to comment.