Skip to content
Snippets Groups Projects
Commit a27879c0 authored by Yamagishi Kazutoshi's avatar Yamagishi Kazutoshi Committed by Eugen Rochko
Browse files

Replace state to /web when root path (#4009)

parent 049cea30
No related branches found
No related tags found
No related merge requests found
......@@ -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'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment