Skip to content

Commit

Permalink
Merge pull request #18053 from vector-im/t3chguy/fix/18032
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy committed Jul 19, 2021
2 parents ae2e3e8 + 331678b commit 7f735a6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/vector/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ function onNewScreen(screen: string, replaceLast = false) {
const hash = '#/' + screen;
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) {
window.location.replace(hash);
} else {
Expand Down

0 comments on commit 7f735a6

Please sign in to comment.