Skip to content

Commit

Permalink
enable add button for manually created transcription task
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikvirendrar committed Aug 11, 2024
1 parent 9a563ec commit 9ce14e5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ const SettingsButtonComponent = ({
<Tooltip title="Add Subtitle Box" placement="bottom">
<IconButton
className={classes.rightPanelBtnGrp}
disabled={currentIndex === -1}
disabled={currentIndex === -1 && taskData?.source_type !== "Manually Created"}
sx={{
"&.Mui-disabled": { backgroundColor: "lightgray" },
}}
Expand Down
16 changes: 16 additions & 0 deletions src/utils/subtitleUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,21 @@ export const addSubtitleBox = (index) => {

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(
Expand All @@ -110,6 +125,7 @@ export const addSubtitleBox = (index) => {
);

return copySub;
}
};

export const onMerge = (index, votr=false) => {
Expand Down

0 comments on commit 9ce14e5

Please sign in to comment.