mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 07:38:07 -05:00
let pathname end without a slash
This commit is contained in:
parent
d9fdb67543
commit
79ae4dd511
1 changed files with 6 additions and 2 deletions
|
@ -743,13 +743,17 @@ const ConnectedPreview = connect(
|
|||
|
||||
// replace old Scratch 2.0-style hashtag URLs with updated format
|
||||
if (window.location.hash) {
|
||||
let pathname = window.location.pathname;
|
||||
if (pathname.substr(-1) !== '/') {
|
||||
pathname = `${pathname}/`;
|
||||
}
|
||||
if (window.location.hash === '#editor') {
|
||||
history.replaceState({}, document.title,
|
||||
`${window.location.origin}${window.location.pathname}editor${window.location.search}`);
|
||||
`${pathname}editor${window.location.search}`);
|
||||
}
|
||||
if (window.location.hash === '#fullscreen') {
|
||||
history.replaceState({}, document.title,
|
||||
`${window.location.origin}${window.location.pathname}fullscreen${window.location.search}`);
|
||||
`${pathname}fullscreen${window.location.search}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue