Skip to content

Commit

Permalink
fix: extra pop up after creating new project CircuitVerse#399
Browse files Browse the repository at this point in the history
  • Loading branch information
nickhil-verma committed Jan 15, 2025
1 parent d23d0b6 commit 42aef0f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/simulator/src/data/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ export async function clearProject() {
Function used to start a new project while prompting confirmation from the user
*/
export async function newProject(verify: boolean) {
// Check if verification is not required and unsaved changes exist

if (
!verify &&
(!projectSaved && checkToSave()) &&
!(await confirmOption(
'What you like to start a new project? Any unsaved changes will be lost.'
))
) {
return // Abort if user does not confirm
return
}

// Proceed to clear project and create a new one if confirmed or conditions met
Expand Down

0 comments on commit 42aef0f

Please sign in to comment.