Fix hash and query parameter ordering and repeating (#99)
This would happen after opening the "Add server" modal Before: ``` /?search=&homeserver=foo.bar#/add-server?search=&homeserver=foo.bar ``` After: ``` /?search=&homeserver=foo.bar#/add-server ```
This commit is contained in:
parent
6bb88b1ecd
commit
75d4a14845
|
@ -28,22 +28,22 @@ class ArchiveHistory extends History {
|
||||||
// downstream call of `urlRouter.attach()` which we do when bootstraping
|
// downstream call of `urlRouter.attach()` which we do when bootstraping
|
||||||
// everything.
|
// everything.
|
||||||
if (window.history) {
|
if (window.history) {
|
||||||
let replacingUrl = url;
|
let replacingUrl = window.location.search + url;
|
||||||
// This is a way to make sure the hash gets cleared out
|
// This is a way to make sure the hash gets cleared out
|
||||||
if (url === '') {
|
if (url === '') {
|
||||||
replacingUrl = window.location.pathname;
|
replacingUrl = window.location.pathname + window.location.search;
|
||||||
}
|
}
|
||||||
super.replaceUrlSilently(replacingUrl + window.location.search);
|
super.replaceUrlSilently(replacingUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pushUrlSilently(url) {
|
pushUrlSilently(url) {
|
||||||
let replacingUrl = url;
|
let replacingUrl = window.location.search + url;
|
||||||
// This is a way to make sure the hash gets cleared out
|
// This is a way to make sure the hash gets cleared out
|
||||||
if (url === '') {
|
if (url === '') {
|
||||||
replacingUrl = window.location.pathname;
|
replacingUrl = window.location.pathname + window.location.search;
|
||||||
}
|
}
|
||||||
super.pushUrlSilently(replacingUrl + window.location.search);
|
super.pushUrlSilently(replacingUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make the URLs we use in the UI of the app relative to the room:
|
// Make the URLs we use in the UI of the app relative to the room:
|
||||||
|
|
Loading…
Reference in New Issue