Skip to content

Commit

Permalink
Merge pull request #65 from ajinkyapandetekdi/ALL-1.0.1
Browse files Browse the repository at this point in the history
IssueId #219606 feat: on submit should call the learnerai API call in…
  • Loading branch information
gouravmore authored May 23, 2024
2 parents c42ed14 + abc1ff9 commit 451b846
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/Layouts.jsx/MainLayout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,13 @@ const MainLayout = (props) => {
{enableNext ? (
<Box
sx={{ cursor: "pointer" }}
onClick={() => handleNext()}
onClick={() => {
if (props.setIsNextButtonCalled) {
props.setIsNextButtonCalled(true);
} else {
handleNext();
}
}}
>
<NextButton />
</Box>
Expand Down
2 changes: 2 additions & 0 deletions src/components/Mechanism/WordsOrImage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ const WordsOrImage = ({
livesData,
gameOverData,
loading,
setIsNextButtonCalled
}}
>
<CardContent
Expand Down Expand Up @@ -250,6 +251,7 @@ const WordsOrImage = ({
dontShowListen={type == "image" || isDiscover}
// updateStory={updateStory}
originalText={words}
handleNext={handleNext}
{...{
contentId,
contentType,
Expand Down
6 changes: 6 additions & 0 deletions src/utils/VoiceAnalyser.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,12 +400,18 @@ function VoiceAnalyser(props) {
);

setApiResponse(callUpdateLearner ? data.status : "success");
if(props.handleNext){
props.handleNext();
}
setLoader(false);
if( props.setIsNextButtonCalled){
props.setIsNextButtonCalled(false);
}
} catch (error) {
setLoader(false);
if(props.handleNext){
props.handleNext();
}
if( props.setIsNextButtonCalled){
props.setIsNextButtonCalled(false);
}
Expand Down

0 comments on commit 451b846

Please sign in to comment.