Skip to content

Commit

Permalink
Merge pull request #36 from vaibhavsTekdi/release-4.0
Browse files Browse the repository at this point in the history
Hot Fix about missed code related abort controller
  • Loading branch information
gouravmore authored Jul 19, 2023
2 parents 2a0ca97 + 9823052 commit 2a9d190
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/VoiceCompair/VoiceCompair.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,14 @@ const VoiceCompair = props => {
},
],
});

const abortController = new AbortController();
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: payload,
redirect: 'follow',
signal: abortController.signal
};

const apiURL = `${ASR_REST_URLS[sourceLanguage]}/services/inference/asr/?serviceId=${asr_language_code}`;
Expand Down Expand Up @@ -230,7 +233,10 @@ const VoiceCompair = props => {
console.log('error', error);
}
});
const waitAlert = setTimeout(()=>{alert('Server response is slow at this time. Please explore other lessons')}, 10000);
const waitAlert = setTimeout(() => {
abortController.abort();
alert('Server response is slow at this time. Please explore other lessons');
}, 10000);
};

//get permission
Expand Down

0 comments on commit 2a9d190

Please sign in to comment.