From 9ce14e5f3b5e992dc5fd606f7ec01dd14ce9f407 Mon Sep 17 00:00:00 2001 From: kartikvirendrar Date: Sun, 11 Aug 2024 15:39:38 +0530 Subject: [PATCH] enable add button for manually created transcription task --- .../Video/components/SettingsButtonComponent.jsx | 2 +- src/utils/subtitleUtils.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/containers/Organization/Video/components/SettingsButtonComponent.jsx b/src/containers/Organization/Video/components/SettingsButtonComponent.jsx index 4e2590ec..b93187ee 100644 --- a/src/containers/Organization/Video/components/SettingsButtonComponent.jsx +++ b/src/containers/Organization/Video/components/SettingsButtonComponent.jsx @@ -163,7 +163,7 @@ const SettingsButtonComponent = ({ { const copySub = [...subtitles]; + if(index === -1){ + copySub.splice( + 0, + 0, + newSub({ + start_time: DT.d2t(0), + end_time: DT.d2t(0), + text: "", + speaker_id: "", + target_text: "", + }) + ); + + return copySub; + }else{ const duration = DT.t2d(copySub[index].end_time); copySub.splice( @@ -110,6 +125,7 @@ export const addSubtitleBox = (index) => { ); return copySub; + } }; export const onMerge = (index, votr=false) => {