File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
packages/app/src/app/result Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -33,14 +33,18 @@ export const ReplayCode = ({ code }: TReplayCode) => {
3333
3434 if ( isPlaying && replayTimeStamp && currentIndex < replayTimeStamp . length ) {
3535 const currentTimestamp = replayTimeStamp [ currentIndex ] ;
36- const nextTimestampDelay =
37- currentIndex + 1 < replayTimeStamp . length
38- ? replayTimeStamp [ currentIndex + 1 ] . time - currentTimestamp . time
39- : null ;
36+ let nextTimestampDelay = 0 ;
37+
38+ if ( currentIndex + 1 < replayTimeStamp . length ) {
39+ nextTimestampDelay =
40+ replayTimeStamp [ currentIndex + 1 ] . time - currentTimestamp . time ;
41+ } else {
42+ return ;
43+ }
4044
4145 timeout = setTimeout ( ( ) => {
4246 setCurrentIndex ( currentIndex + 1 ) ;
43- } , nextTimestampDelay || currentTimestamp . time ) ;
47+ } , nextTimestampDelay ) ;
4448 }
4549
4650 return ( ) => clearTimeout ( timeout ) ;
You can’t perform that action at this time.
0 commit comments