File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed
ngx-components/src/lib/components/audio/audio-viewer Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -328,7 +328,7 @@ export class OctraAnnotation<
328
328
new OctraAnnotationSegment (
329
329
this . idCounters . item ++ ,
330
330
time ! ,
331
- labels ?? oldLabels ,
331
+ labels && ( labels . length > 0 ) ? labels : oldLabels ,
332
332
context ?? { }
333
333
) as any ,
334
334
] ;
@@ -880,7 +880,9 @@ export class OctraAnnotationEventLevel {
880
880
881
881
getRightSibling ( item : OctraAnnotationEvent ) {
882
882
const index = this . items . findIndex ( ( a ) => a . id === item . id ) ;
883
- return index > - 1 && index < this . items . length - 1 ? this . items [ index + 1 ] : undefined ;
883
+ return index > - 1 && index < this . items . length - 1
884
+ ? this . items [ index + 1 ]
885
+ : undefined ;
884
886
}
885
887
}
886
888
Original file line number Diff line number Diff line change @@ -893,8 +893,7 @@ export class AudioViewerService {
893
893
// no selection
894
894
895
895
this . addSegment (
896
- this . audioManager ! . createSampleUnit ( Math . round ( absXTime ) ) ,
897
- ''
896
+ this . audioManager ! . createSampleUnit ( Math . round ( absXTime ) )
898
897
) ;
899
898
900
899
return {
@@ -1199,16 +1198,18 @@ export class AudioViewerService {
1199
1198
}
1200
1199
1201
1200
public addSegment ( start : SampleUnit , value ?: string ) {
1202
- const result = this . annotation ! . addItemToCurrentLevel ( start , [
1203
- new OLabel ( this . currentLevel ! . name , value ?? '' ) ,
1204
- ] ) ;
1201
+ const result = this . annotation ! . addItemToCurrentLevel (
1202
+ start ,
1203
+ value ? [ new OLabel ( this . currentLevel ! . name , value ) ] : undefined
1204
+ ) ;
1205
1205
this . currentLevelChange . emit ( {
1206
1206
type : 'add' ,
1207
1207
items : [
1208
1208
{
1209
- instance : this . annotation ! . createSegment ( start , [
1210
- new OLabel ( this . currentLevel ! . name , value ?? '' ) ,
1211
- ] ) ,
1209
+ instance : this . annotation ! . createSegment (
1210
+ start ,
1211
+ value ? [ new OLabel ( this . currentLevel ! . name , value ) ] : undefined
1212
+ ) ,
1212
1213
} ,
1213
1214
] ,
1214
1215
} ) ;
You can’t perform that action at this time.
0 commit comments