Skip to content

Commit 7907672

Browse files
authored
Merge pull request #2590 from lindapaiste/fix/file-new
Fix bug where clicking "File > New" doesn't open a new sketch
2 parents 5d39d49 + e64680e commit 7907672

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

client/modules/IDE/actions/project.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,7 @@ export function resetProject() {
270270
}
271271

272272
export function newProject() {
273-
setTimeout(() => {
274-
browserHistory.push('/');
275-
}, 0);
273+
browserHistory.push('/', { confirmed: true });
276274
return resetProject();
277275
}
278276

client/modules/IDE/pages/IDEView.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ function WarnIfUnsavedChanges() {
5656
isAuth(nextLocation.pathname) ||
5757
isAuth(currentLocation.pathname) ||
5858
isOverlay(nextLocation.pathname) ||
59-
isOverlay(currentLocation.pathname)
59+
isOverlay(currentLocation.pathname) ||
60+
nextLocation.state?.confirmed
6061
) {
6162
return true; // allow navigation
6263
}

0 commit comments

Comments
 (0)