File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -563,12 +563,19 @@ export default class Page extends EventEmitter {
563
563
const matchTimeNodes = Object . keys ( this . timeActions )
564
564
. map ( Number )
565
565
. sort ( )
566
- . filter ( time => currentTime >= time )
567
- . shift ( ) ;
568
- const timeAction = this . timeActions [ matchTimeNodes ]
569
- timeAction && await timeAction ( this )
570
- . catch ( err => this . #emitError( err ) )
571
- . finally ( ( ) => delete this . timeActions [ matchTimeNodes ] ) ;
566
+ . find ( time => currentTime >= time ) ;
567
+ if ( ! matchTimeNodes )
568
+ return ;
569
+ const timeAction = this . timeActions [ matchTimeNodes ] ;
570
+ delete this . timeActions [ matchTimeNodes ]
571
+ try {
572
+ const result = timeAction ( this ) ;
573
+ if ( result instanceof Promise )
574
+ await result . catch ( err => this . #emitError( err ) )
575
+ }
576
+ catch ( err ) {
577
+ this . #emitError( err )
578
+ }
572
579
}
573
580
574
581
/**
You can’t perform that action at this time.
0 commit comments