@@ -295,17 +295,17 @@ class AnnotationTopBarContainer extends React.PureComponent<Props> {
295
295
}
296
296
297
297
private undo = ( ) : void => {
298
- const { undo, canvasIsReady , undoAction } = this . props ;
298
+ const { undo, undoAction } = this . props ;
299
299
300
- if ( isAbleToChangeFrame ( ) && canvasIsReady && undoAction ) {
300
+ if ( isAbleToChangeFrame ( ) && undoAction ) {
301
301
undo ( ) ;
302
302
}
303
303
} ;
304
304
305
305
private redo = ( ) : void => {
306
- const { redo, canvasIsReady , redoAction } = this . props ;
306
+ const { redo, redoAction } = this . props ;
307
307
308
- if ( isAbleToChangeFrame ( ) && canvasIsReady && redoAction ) {
308
+ if ( isAbleToChangeFrame ( ) && redoAction ) {
309
309
redo ( ) ;
310
310
}
311
311
} ;
@@ -335,12 +335,12 @@ class AnnotationTopBarContainer extends React.PureComponent<Props> {
335
335
private onFirstFrame = async ( ) : Promise < void > => {
336
336
const {
337
337
frameNumber, jobInstance, playing,
338
- onSwitchPlay, showDeletedFrames, canvasIsReady ,
338
+ onSwitchPlay, showDeletedFrames,
339
339
} = this . props ;
340
340
341
341
const newFrame =
342
342
await jobInstance . frames . search ( { notDeleted : ! showDeletedFrames } , jobInstance . startFrame , frameNumber ) ;
343
- if ( newFrame !== frameNumber && newFrame !== null && canvasIsReady ) {
343
+ if ( newFrame !== frameNumber && newFrame !== null ) {
344
344
if ( playing ) {
345
345
onSwitchPlay ( false ) ;
346
346
}
@@ -351,7 +351,7 @@ class AnnotationTopBarContainer extends React.PureComponent<Props> {
351
351
private onBackward = async ( ) : Promise < void > => {
352
352
const {
353
353
frameNumber, frameStep, jobInstance, playing,
354
- onSwitchPlay, showDeletedFrames, canvasIsReady ,
354
+ onSwitchPlay, showDeletedFrames,
355
355
} = this . props ;
356
356
357
357
const newFrame = await jobInstance . frames . search (
@@ -360,7 +360,7 @@ class AnnotationTopBarContainer extends React.PureComponent<Props> {
360
360
jobInstance . startFrame ,
361
361
) ;
362
362
363
- if ( newFrame !== frameNumber && newFrame !== null && canvasIsReady ) {
363
+ if ( newFrame !== frameNumber && newFrame !== null ) {
364
364
if ( playing ) {
365
365
onSwitchPlay ( false ) ;
366
366
}
@@ -371,7 +371,7 @@ class AnnotationTopBarContainer extends React.PureComponent<Props> {
371
371
private onPrevFrame = async ( ) : Promise < void > => {
372
372
const {
373
373
frameNumber, jobInstance, playing, searchAnnotations,
374
- onSwitchPlay, showDeletedFrames, canvasIsReady , navigationType,
374
+ onSwitchPlay, showDeletedFrames, navigationType,
375
375
} = this . props ;
376
376
const { startFrame } = jobInstance ;
377
377
@@ -382,7 +382,7 @@ class AnnotationTopBarContainer extends React.PureComponent<Props> {
382
382
jobInstance . startFrame ,
383
383
) ;
384
384
385
- if ( newFrame !== frameNumber && newFrame !== null && canvasIsReady && isAbleToChangeFrame ( ) ) {
385
+ if ( newFrame !== frameNumber && newFrame !== null && isAbleToChangeFrame ( ) ) {
386
386
if ( playing ) {
387
387
onSwitchPlay ( false ) ;
388
388
}
@@ -400,7 +400,7 @@ class AnnotationTopBarContainer extends React.PureComponent<Props> {
400
400
private onNextFrame = async ( ) : Promise < void > => {
401
401
const {
402
402
frameNumber, jobInstance, playing, searchAnnotations,
403
- onSwitchPlay, showDeletedFrames, canvasIsReady , navigationType,
403
+ onSwitchPlay, showDeletedFrames, navigationType,
404
404
} = this . props ;
405
405
const { stopFrame } = jobInstance ;
406
406
@@ -410,7 +410,7 @@ class AnnotationTopBarContainer extends React.PureComponent<Props> {
410
410
frameFrom ,
411
411
jobInstance . stopFrame ,
412
412
) ;
413
- if ( newFrame !== frameNumber && newFrame !== null && canvasIsReady && isAbleToChangeFrame ( ) ) {
413
+ if ( newFrame !== frameNumber && newFrame !== null && isAbleToChangeFrame ( ) ) {
414
414
if ( playing ) {
415
415
onSwitchPlay ( false ) ;
416
416
}
@@ -428,7 +428,7 @@ class AnnotationTopBarContainer extends React.PureComponent<Props> {
428
428
private onForward = async ( ) : Promise < void > => {
429
429
const {
430
430
frameNumber, frameStep, jobInstance, playing,
431
- onSwitchPlay, showDeletedFrames, canvasIsReady ,
431
+ onSwitchPlay, showDeletedFrames,
432
432
} = this . props ;
433
433
434
434
const newFrame = await jobInstance . frames . search (
@@ -437,7 +437,7 @@ class AnnotationTopBarContainer extends React.PureComponent<Props> {
437
437
jobInstance . stopFrame ,
438
438
) ;
439
439
440
- if ( newFrame !== frameNumber && newFrame !== null && canvasIsReady ) {
440
+ if ( newFrame !== frameNumber && newFrame !== null ) {
441
441
if ( playing ) {
442
442
onSwitchPlay ( false ) ;
443
443
}
@@ -448,12 +448,12 @@ class AnnotationTopBarContainer extends React.PureComponent<Props> {
448
448
private onLastFrame = async ( ) : Promise < void > => {
449
449
const {
450
450
frameNumber, jobInstance, playing,
451
- onSwitchPlay, showDeletedFrames, canvasIsReady ,
451
+ onSwitchPlay, showDeletedFrames,
452
452
} = this . props ;
453
453
454
454
const newFrame =
455
455
await jobInstance . frames . search ( { notDeleted : ! showDeletedFrames } , jobInstance . stopFrame , frameNumber ) ;
456
- if ( newFrame !== frameNumber && frameNumber !== null && canvasIsReady ) {
456
+ if ( newFrame !== frameNumber && newFrame !== null ) {
457
457
if ( playing ) {
458
458
onSwitchPlay ( false ) ;
459
459
}
@@ -463,12 +463,11 @@ class AnnotationTopBarContainer extends React.PureComponent<Props> {
463
463
464
464
private searchAnnotations = ( direction : 'forward' | 'backward' ) : void => {
465
465
const {
466
- frameNumber, jobInstance,
467
- canvasIsReady, searchAnnotations,
466
+ frameNumber, jobInstance, searchAnnotations,
468
467
} = this . props ;
469
468
const { startFrame, stopFrame } = jobInstance ;
470
469
471
- if ( isAbleToChangeFrame ( ) && canvasIsReady ) {
470
+ if ( isAbleToChangeFrame ( ) ) {
472
471
if ( direction === 'forward' && frameNumber + 1 <= stopFrame ) {
473
472
searchAnnotations ( jobInstance , frameNumber + 1 , stopFrame ) ;
474
473
} else if ( direction === 'backward' && frameNumber - 1 >= startFrame ) {
@@ -557,9 +556,11 @@ class AnnotationTopBarContainer extends React.PureComponent<Props> {
557
556
558
557
private onDeleteFrame = ( ) : void => {
559
558
const {
560
- deleteFrame, frameNumber, jobInstance, canvasIsReady ,
559
+ deleteFrame, frameNumber, jobInstance,
561
560
} = this . props ;
562
- if ( canvasIsReady && jobInstance . type !== JobType . GROUND_TRUTH ) deleteFrame ( frameNumber ) ;
561
+ if ( jobInstance . type !== JobType . GROUND_TRUTH ) {
562
+ deleteFrame ( frameNumber ) ;
563
+ }
563
564
} ;
564
565
565
566
private onRestoreFrame = ( ) : void => {
0 commit comments