Skip to content

Commit 2c9273a

Browse files
committed
avoid the initial sync from clobbering the location bar
1 parent bc3ee94 commit 2c9273a

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/vector/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,15 @@ var lastLoadedScreen = null;
9999

100100
// This will be called whenever the SDK changes screens,
101101
// so a web page can update the URL bar appropriately.
102-
var onNewScreen = function(screen) {
102+
var onNewScreen = function(screen, onlyIfBlank) {
103103
if (!loaded) {
104104
lastLoadedScreen = screen;
105105
} else {
106-
var hash = '#/' + screen;
107-
lastLocationHashSet = hash;
108-
window.location.hash = hash;
106+
if (!onlyIfBlank || !window.location.hash) {
107+
var hash = '#/' + screen;
108+
lastLocationHashSet = hash;
109+
window.location.hash = hash;
110+
}
109111
}
110112
}
111113

0 commit comments

Comments
 (0)