From 42aef0f82f74997e4d29f6fb5f1671dc7535dab7 Mon Sep 17 00:00:00 2001 From: Nikhil Verma Date: Wed, 15 Jan 2025 22:42:00 +0530 Subject: [PATCH] fix: extra pop up after creating new project #399 --- src/simulator/src/data/project.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/simulator/src/data/project.ts b/src/simulator/src/data/project.ts index e998379c..d916b94a 100644 --- a/src/simulator/src/data/project.ts +++ b/src/simulator/src/data/project.ts @@ -155,7 +155,7 @@ 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()) && @@ -163,7 +163,7 @@ export async function newProject(verify: boolean) { '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