diff --git a/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx b/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx index d0425a02..f4005c2e 100644 --- a/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx +++ b/src/ui/pages/container/CL-Transcription/AudioTranscriptionLandingPage.jsx @@ -489,7 +489,6 @@ const AudioTranscriptionLandingPage = ({project_type}) => { useEffect(() => { let standardisedTranscription = ""; - const sub = annotations[0]?.result.filter((item) => { if ("standardised_transcription" in item) { standardisedTranscription = item.standardised_transcription; diff --git a/src/utils/Sub.js b/src/utils/Sub.js index a0ae2952..8678433b 100644 --- a/src/utils/Sub.js +++ b/src/utils/Sub.js @@ -14,7 +14,9 @@ export default class Sub { this.audio_speed = obj.audio_speed; this.speaker_id = obj.speaker_id; this.acoustic_normalised_text = obj.acoustic_normalised_text ?? ""; - this.acoustic_standardized_text = obj.acoustic_standardized_text ? obj.acoustic_standardized_text : this.acoustic_normalised_text; + if (obj.acoustic_standardized_text) { + this.acoustic_standardized_text = obj.acoustic_standardized_text; + } } get check() { diff --git a/src/utils/SubTitlesUtils.js b/src/utils/SubTitlesUtils.js index ca7cc3a2..91a7b749 100644 --- a/src/utils/SubTitlesUtils.js +++ b/src/utils/SubTitlesUtils.js @@ -107,7 +107,7 @@ export const addSubtitleBox = (index, stage, updatedProjectData) => { speaker_id: "", target_text: "", acoustic_normalised_text: "", - acoustic_standardized_text: "", + ...(stage === 3 && {acoustic_standardized_text: ""}) }) ); console.log(copySub) @@ -241,7 +241,7 @@ export const onSubtitleChange = (text, index, updateAcoustic, populateAcoustic, console.log(copySub) const sub = copySub[index]; console.log(sub); - if (updateAcoustic === 1) + if (updateAcoustic === 1 || updateAcoustic === true) sub.acoustic_normalised_text = text; else if (populateAcoustic) { @@ -251,7 +251,7 @@ console.log(sub); else if(updateAcoustic === 2) sub.acoustic_standardized_text = text; - else if(updateAcoustic === 0) + else if(updateAcoustic === 0 || updateAcoustic === false) sub.text = text;