Merge pull request #18053 from vector-im/t3chguy/fix/18032

pull/18058/head
Michael Telatynski 2021-07-19 12:53:37 +01:00 committed by GitHub
commit 7f735a6c6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -73,6 +73,14 @@ function onNewScreen(screen: string, replaceLast = false) {
const hash = '#/' + screen; const hash = '#/' + screen;
lastLocationHashSet = hash; lastLocationHashSet = hash;
// if the new hash is a substring of the old one then we are stripping fields e.g `via` so replace history
if (screen.startsWith("room/") &&
window.location.hash.includes("/$") === hash.includes("/$") && // only if both did or didn't contain event link
window.location.hash.startsWith(hash)
) {
replaceLast = true;
}
if (replaceLast) { if (replaceLast) {
window.location.replace(hash); window.location.replace(hash);
} else { } else {