Updated the code to solve the double stats creation

This commit is contained in:
Tiago Ribeiro
2024-03-24 00:46:42 +00:00
parent 51cc1e3f36
commit 29b2c8b3b8
3 changed files with 14 additions and 9 deletions

View File

@@ -20,6 +20,9 @@ export default function Speaking({id, type, title, video_url, text, prompts, use
useEffect(() => {
if (userSolutions && userSolutions.length > 0 && userSolutions[0].solution) {
const solution = userSolutions[0].solution;
if (solution.startsWith("https://")) return setSolutionURL(solution);
axios.post(`/api/speaking`, {path: userSolutions[0].solution}, {responseType: "arraybuffer"}).then(({data}) => {
const blob = new Blob([data], {type: "audio/wav"});
const url = URL.createObjectURL(blob);