File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,11 @@ import { shortTimecode } from '../timecode-converter';
21
21
22
22
export const generatePreviousTimings = ( time ) => {
23
23
// https://stackoverflow.com/questions/3746725/how-to-create-an-array-containing-1-n
24
- return [ ...Array ( parseInt ( time ) ) . keys ( ) ] ;
24
+ if ( time ) {
25
+ return [ ...Array ( parseInt ( time ) ) . keys ( ) ] ;
26
+ } else {
27
+ return [ 0 ] ;
28
+ }
25
29
} ;
26
30
27
31
/**
@@ -68,6 +72,8 @@ const convertDpeToSlate = (transcript) => {
68
72
children : [
69
73
{
70
74
text : 'Text' ,
75
+ // Adding list of words in slateJs paragraphs
76
+ words : [ ] ,
71
77
} ,
72
78
] ,
73
79
} ,
@@ -83,7 +89,13 @@ const convertDpeToSlate = (transcript) => {
83
89
// pre-computing the display of the formatting here so that it doesn't need to convert it in leaf render
84
90
startTimecode : shortTimecode ( paragraph . start ) ,
85
91
type : 'timedText' ,
86
- children : [ { text : generateText ( paragraph , words ) } ] ,
92
+ children : [
93
+ {
94
+ text : generateText ( paragraph , words ) ,
95
+ // Adding list of words in slateJs paragraphs
96
+ words,
97
+ } ,
98
+ ] ,
87
99
} ) ) ;
88
100
} ;
89
101
You can’t perform that action at this time.
0 commit comments