Skip to content

Commit

Permalink
Issue #getsetresult issue fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gouravmore committed Oct 19, 2024
1 parent 140e2f9 commit 1e8cc47
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/views/Practice/Practice.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ const Practice = () => {
let newQuestionIndex =
currentQuestion === questions.length - 1 ? 0 : currentQuestion + 1;

const currentGetContent = levelGetContent?.[level]?.find(
(elem) => elem.title === practiceSteps?.[newPracticeStep].name
);

if (currentQuestion === questions.length - 1 || isGameOver) {
// navigate or setNextPracticeLevel
let currentPracticeStep =
Expand All @@ -233,7 +237,10 @@ const Practice = () => {
user_id: virtualId,
totalSyllableCount: totalSyllableCount,
language: localStorage.getItem("lang"),
is_mechanics: currentGetContent?.mechanism?.id ? true : false,
is_mechanics:
currentGetContent && currentGetContent?.mechanism?.id
? true
: false,
}
);
const { data: getSetData } = getSetResultRes;
Expand Down Expand Up @@ -284,10 +291,6 @@ const Practice = () => {
currentPracticeProgress = 0;
}

const currentGetContent = levelGetContent?.[level]?.find(
(elem) => elem.title === practiceSteps?.[newPracticeStep].name
);

await axios.post(
`${process.env.REACT_APP_LEARNER_AI_ORCHESTRATION_HOST}/${config.URLS.ADD_LESSON}`,
{
Expand Down

0 comments on commit 1e8cc47

Please sign in to comment.