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 42aef0f commit 9f29538
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
return // Abort if user does not confirm
}

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

0 comments on commit 9f29538

Please sign in to comment.