Commit d9fdb675 authored by Ben Wheeler's avatar Ben Wheeler

redirect hash urls to url pathnames

parent 3b1b96a0
......@@ -741,6 +741,19 @@ const ConnectedPreview = connect(
mapDispatchToProps
)(Preview);
// replace old Scratch 2.0-style hashtag URLs with updated format
if (window.location.hash) {
if (window.location.hash === '#editor') {
history.replaceState({}, document.title,
`${window.location.origin}${window.location.pathname}editor${window.location.search}`);
}
if (window.location.hash === '#fullscreen') {
history.replaceState({}, document.title,
`${window.location.origin}${window.location.pathname}fullscreen${window.location.search}`);
}
}
// initialize GUI by calling its reducer functions depending on URL
GUI.setAppElement(document.getElementById('app'));
const initGuiState = guiInitialState => {
const pathname = window.location.pathname.toLowerCase();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment