mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
Merge pull request #15127 from vector-im/t3chguy/fix/3543
Fix onNewScreen to use replace when going from roomId->roomAlias
This commit is contained in:
commit
a700502086
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user