diff --git a/emain/emain-viewmgr.ts b/emain/emain-viewmgr.ts index 535ff3817..74838ee36 100644 --- a/emain/emain-viewmgr.ts +++ b/emain/emain-viewmgr.ts @@ -467,6 +467,8 @@ function createBaseWaveBrowserWindow( }); if (choice === 0) { e.preventDefault(); + } else { + win.deleteAllowed = true; } }); win.on("closed", () => { @@ -482,7 +484,7 @@ function createBaseWaveBrowserWindow( if (numWindows == 0) { return; } - if (!win.alreadyClosed) { + if (!win.alreadyClosed && win.deleteAllowed) { console.log("win removing window from backend DB", win.waveWindowId); WindowService.CloseWindow(waveWindow.oid, true); } diff --git a/frontend/types/custom.d.ts b/frontend/types/custom.d.ts index f80859197..42d4dc78d 100644 --- a/frontend/types/custom.d.ts +++ b/frontend/types/custom.d.ts @@ -358,6 +358,7 @@ declare global { allTabViews: Map; activeTabView: WaveTabView; alreadyClosed: boolean; + deleteAllowed: boolean; }; type WaveTabView = Electron.WebContentsView & {