Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Enable the possibility to go back #124

Merged
merged 2 commits into from
Dec 6, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export default function App() {
const appLayout = useLayout(app);

useEffect(() => () => {
window.onpopstate = () => { window.location.reload(false); };

if (!app) return;
session.close();
}, [app]);
Expand Down
2 changes: 1 addition & 1 deletion src/components/splash.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function Splash({
const UniformedAppId = appId.charAt(0) === '/' ? appId : `/${appId}`;
newURL = `${new URL(newURL).origin}${UniformedAppId}`;
}
window.history.replaceState({}, '', `${window.location.pathname}?engine_url=${encodeURI(newURL)}`);
window.history.pushState({}, '', `${window.location.pathname}?engine_url=${encodeURI(newURL)}`);
window.location.reload(false);
}

Expand Down