diff --git a/src/ui/pages/container/CL-Transcription/AllAudioTranscriptionLandingPage.jsx b/src/ui/pages/container/CL-Transcription/AllAudioTranscriptionLandingPage.jsx index 4a471a40f..2abf59d67 100644 --- a/src/ui/pages/container/CL-Transcription/AllAudioTranscriptionLandingPage.jsx +++ b/src/ui/pages/container/CL-Transcription/AllAudioTranscriptionLandingPage.jsx @@ -177,7 +177,7 @@ const AllAudioTranscriptionLandingPage = () => { const tasksComplete = (id) => { if (id) { navigate(`/projects/${projectId}/AllAudioTranscriptionLandingPage/${id}`); - window.location.reload(); + window.location.reload(true); } else { setSnackbarInfo({ open: true, @@ -187,7 +187,7 @@ const AllAudioTranscriptionLandingPage = () => { setTimeout(() => { localStorage.removeItem("labelAll"); window.location.replace(`/#/projects/${projectId}`); - window.location.reload(true); + window.location.reload(); }, 1000); } }; diff --git a/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx b/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx index 0ba17a8ee..d4a451672 100644 --- a/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx +++ b/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx @@ -297,7 +297,7 @@ const AudioTranscriptionLandingPage = () => { const handleAutosave = async () => { setAutoSaveTrigger(false); - if(taskDetails?.task_status !== "labeled"){ + if(AnnotationsTaskDetails[0]?.annotation_status !== "labeled"){ if(!autoSave) return; const reqBody = { task_id: taskId, @@ -315,9 +315,10 @@ const AudioTranscriptionLandingPage = () => { headers: obj.getHeaders().headers, }); if (!res.ok) { + const data = await res.json(); setSnackbarInfo({ open: true, - message: "Error in autosaving annotation", + message: data.message, variant: "error", }); } diff --git a/src/ui/pages/container/CL-Transcription/ReviewAudioTranscriptionLandingPage.jsx b/src/ui/pages/container/CL-Transcription/ReviewAudioTranscriptionLandingPage.jsx index 2affc5194..8ee4c4173 100644 --- a/src/ui/pages/container/CL-Transcription/ReviewAudioTranscriptionLandingPage.jsx +++ b/src/ui/pages/container/CL-Transcription/ReviewAudioTranscriptionLandingPage.jsx @@ -312,7 +312,7 @@ const ReviewAudioTranscriptionLandingPage = () => { const handleAutosave = async () => { setAutoSaveTrigger(false); - if(taskDetails?.task_status !== "accepted" && taskDetails?.task_status !== "accepted_with_minor_changes" && taskDetails?.task_status !== "accepted_with_major_changes"){ + if(AnnotationsTaskDetails[0]?.annotation_status !== "accepted" && AnnotationsTaskDetails[0]?.annotation_status !== "accepted_with_minor_changes" && AnnotationsTaskDetails[0]?.annotation_status !== "accepted_with_major_changes"){ if(!autoSave) return; const currentAnnotation = AnnotationsTaskDetails?.find((a) => a.completed_by === user.id && a.annotation_type === 2); if(!currentAnnotation) return; @@ -332,9 +332,10 @@ const ReviewAudioTranscriptionLandingPage = () => { headers: obj.getHeaders().headers, }); if (!res.ok) { + const data = await res.json(); setSnackbarInfo({ open: true, - message: "Error in autosaving annotation", + message: data.message, variant: "error", }); return res; diff --git a/src/ui/pages/container/CL-Transcription/SuperCheckerAudioTranscriptionLandingPage.jsx b/src/ui/pages/container/CL-Transcription/SuperCheckerAudioTranscriptionLandingPage.jsx index 3cacb0503..96349be1e 100644 --- a/src/ui/pages/container/CL-Transcription/SuperCheckerAudioTranscriptionLandingPage.jsx +++ b/src/ui/pages/container/CL-Transcription/SuperCheckerAudioTranscriptionLandingPage.jsx @@ -234,7 +234,7 @@ const SuperCheckerAudioTranscriptionLandingPage = () => { // eslint-disable-next-line react-hooks/exhaustive-deps const handleAutosave = async () => { setAutoSaveTrigger(false); - if(taskDetails?.task_status !== "validated" && taskDetails?.task_status !== "validated_with_changes"){ + if(AnnotationsTaskDetails[0]?.annotation_status !== "validated" && AnnotationsTaskDetails[0]?.annotation_status !== "validated_with_changes"){ if(!autoSave) return; const currentAnnotation = AnnotationsTaskDetails?.find((a) => a.completed_by === userData.id && a.annotation_type === 3); if(!currentAnnotation) return; @@ -254,9 +254,10 @@ const SuperCheckerAudioTranscriptionLandingPage = () => { headers: obj.getHeaders().headers, }); if (!res.ok) { - setSnackbarInfo({ + const data = await res.json(); + setSnackbarInfo({ open: true, - message: "Error in autosaving annotation", + message: data.message, variant: "error", }); }