b7c00c31c1
Fix https://github.com/matrix-org/matrix-public-archive/pull/104#discussion_r1004023030 ### What was the problem? We were previously seeing this behavior with the old code: ``` Before: http://localhost:3050/!xxx:server/date/2022/09/20?via=my.synapse.server replaceUrlSilently(url='http://localhost:3050/!xxx:server/date/2022/09/20')` After: http://localhost:3050/!xxx:server/date/2022/09/20?via=my.synapse.serverhttp://localhost:3050/!xxx:server/date/2022/07/29 ``` Because `replacingUrl` was evaluating to `replacingUrl = '?via=my.synapse.serverhttp://192.168.1.151:3050/!HBehERstyQBxyJDLfR:my.synapse.server/date/2022/07/29'` which is relative and was appended to the current URL. ### Solution Now with the new code, we more clearly handle the 3 cases: - Normal Hydrogen `#/foo-bar` hash routing on the end of the URL - When `url=''` and we just need clear the Hydrogen hash route and maintain the current path and query parameters - An absolute URL which we can completely replace the page URL with |
||
---|---|---|
.. | ||
lib | ||
viewmodels | ||
views | ||
.eslintrc.json | ||
hydrogen-vm-render-script.js | ||
room-directory-vm-render-script.js |