Commit 9c9f80e 1 parent a66d04f commit 9c9f80e Copy full SHA for 9c9f80e
File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -317,16 +317,18 @@ export function Navigation(props) {
317
317
318
318
dispatch ( { type : 'replace' , stack : newStack , opts : { animate : false } } ) ;
319
319
320
- // Pop to root screen
321
- setTimeout ( ( ) => {
320
+ // TODO: build a more integrated solution for sequencing dispatches
321
+ // For now, we'll use requestAnimationFrame
322
+ requestAnimationFrame ( ( ) => {
323
+ // Pop to root screen
322
324
dispatch ( { type : 'pop' , opts : { animate : props . animate } } ) ;
323
325
324
326
// Update URL
325
327
const url = new URL ( window . location . href ) ;
326
328
url . searchParams . delete ( 'stack' ) ;
327
329
url . searchParams . append ( 'stack' , primaryScreen ) ;
328
330
window . history . replaceState ( { } , '' , url ) ;
329
- } , 0 ) ;
331
+ } ) ;
330
332
} ,
331
333
canPop : canPop ,
332
334
canPopFrom : canPopFrom ,
You can’t perform that action at this time.
0 commit comments