diff --git a/client/modules/IDE/actions/project.js b/client/modules/IDE/actions/project.js index b8ffb13392..aefcea81f0 100644 --- a/client/modules/IDE/actions/project.js +++ b/client/modules/IDE/actions/project.js @@ -270,9 +270,7 @@ export function resetProject() { } export function newProject() { - setTimeout(() => { - browserHistory.push('/'); - }, 0); + browserHistory.push('/', { confirmed: true }); return resetProject(); } diff --git a/client/modules/IDE/pages/IDEView.jsx b/client/modules/IDE/pages/IDEView.jsx index 718613c5ed..02056ba0a5 100644 --- a/client/modules/IDE/pages/IDEView.jsx +++ b/client/modules/IDE/pages/IDEView.jsx @@ -56,7 +56,8 @@ function WarnIfUnsavedChanges() { isAuth(nextLocation.pathname) || isAuth(currentLocation.pathname) || isOverlay(nextLocation.pathname) || - isOverlay(currentLocation.pathname) + isOverlay(currentLocation.pathname) || + nextLocation.state?.confirmed ) { return true; // allow navigation }