mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-23 08:41:12 +01:00
Replace state to /web when root path (#4009)
This commit is contained in:
parent
049cea30b0
commit
a27879c0cf
1 changed files with 8 additions and 0 deletions
|
@ -20,6 +20,14 @@ function main() {
|
|||
|
||||
require.context('../images/', true);
|
||||
|
||||
if (window.history && history.replaceState) {
|
||||
const { pathname, search, hash } = window.location;
|
||||
const path = pathname + search + hash;
|
||||
if (!(/^\/web[$/]/).test(path)) {
|
||||
history.replaceState(null, document.title, `/web${path}`);
|
||||
}
|
||||
}
|
||||
|
||||
onDomContentLoaded(() => {
|
||||
const mountNode = document.getElementById('mastodon');
|
||||
const props = JSON.parse(mountNode.getAttribute('data-props'));
|
||||
|
|
Loading…
Reference in a new issue