avoid the initial sync from clobbering the location bar

pull/351/head
Matthew Hodgson 2015-11-11 02:00:51 +01:00
parent bc3ee949f5
commit 2c9273a86c
1 changed files with 6 additions and 4 deletions

View File

@ -99,14 +99,16 @@ var lastLoadedScreen = null;
// This will be called whenever the SDK changes screens, // This will be called whenever the SDK changes screens,
// so a web page can update the URL bar appropriately. // so a web page can update the URL bar appropriately.
var onNewScreen = function(screen) { var onNewScreen = function(screen, onlyIfBlank) {
if (!loaded) { if (!loaded) {
lastLoadedScreen = screen; lastLoadedScreen = screen;
} else { } else {
if (!onlyIfBlank || !window.location.hash) {
var hash = '#/' + screen; var hash = '#/' + screen;
lastLocationHashSet = hash; lastLocationHashSet = hash;
window.location.hash = hash; window.location.hash = hash;
} }
}
} }
// We use this to work out what URL the SDK should // We use this to work out what URL the SDK should