Skip to content

Commit

Permalink
IssueId #219606 feat: on submit should call the learnerai API call in…
Browse files Browse the repository at this point in the history
… Storylingo [React]
  • Loading branch information
ajinkyapandetekdi committed May 23, 2024
1 parent bb64908 commit abc1ff9
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 abc1ff9

Please sign in to comment.