Skip to content

Commit

Permalink
Merge pull request processing#2590 from lindapaiste/fix/file-new
Browse files Browse the repository at this point in the history
Fix bug where clicking "File > New" doesn't open a new sketch
  • Loading branch information
raclim authored Nov 13, 2023
2 parents 5d39d49 + e64680e commit 7907672
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 1 addition & 3 deletions client/modules/IDE/actions/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,7 @@ export function resetProject() {
}

export function newProject() {
setTimeout(() => {
browserHistory.push('/');
}, 0);
browserHistory.push('/', { confirmed: true });
return resetProject();
}

Expand Down
3 changes: 2 additions & 1 deletion client/modules/IDE/pages/IDEView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 7907672

Please sign in to comment.