Fix onNewScreen to use replace when going from roomId->roomAlias to prevent locking the user in place

pull/15127/head
Michael Telatynski 2020-09-09 16:52:48 +01:00
parent eaa46d1794
commit ac447fd318
1 changed files with 7 additions and 2 deletions

View File

@ -71,11 +71,16 @@ function onHashChange(ev: HashChangeEvent) {
// This will be called whenever the SDK changes screens,
// so a web page can update the URL bar appropriately.
function onNewScreen(screen: string) {
function onNewScreen(screen: string, replaceLast = false) {
console.log("newscreen " + screen);
const hash = '#/' + screen;
lastLocationHashSet = hash;
window.location.hash = hash;
if (replaceLast) {
window.location.replace(hash);
} else {
window.location.assign(hash);
}
}
// We use this to work out what URL the SDK should