File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -53,14 +53,18 @@ function onHashChange(ev) {
5353}
5454
5555var loaded = false ;
56+ var lastLoadedScreen = null ;
5657
5758// This will be called whenever the SDK changes screens,
5859// so a web page can update the URL bar appropriately.
5960var onNewScreen = function ( screen ) {
60- if ( ! loaded ) return ;
61- var hash = '#/' + screen ;
62- lastLocationHashSet = hash ;
63- window . location . hash = hash ;
61+ if ( ! loaded ) {
62+ lastLoadedScreen = screen ;
63+ } else {
64+ var hash = '#/' + screen ;
65+ lastLocationHashSet = hash ;
66+ window . location . hash = hash ;
67+ }
6468}
6569
6670// We use this to work out what URL the SDK should
@@ -85,5 +89,9 @@ window.addEventListener('hashchange', onHashChange);
8589window . onload = function ( ) {
8690 routeUrl ( window . location ) ;
8791 loaded = true ;
92+ if ( lastLoadedScreen ) {
93+ onNewScreen ( lastLoadedScreen ) ;
94+ lastLoadedScreen = null ;
95+ }
8896}
8997
You can’t perform that action at this time.
0 commit comments