make sure the user affirmatively acknowledged window deletion before deleting, fix for #1167 (#1181)

This commit is contained in:
Mike Sawka 2024-10-31 18:13:27 -07:00 committed by GitHub
parent e10bcee05a
commit 48001ee734
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -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);
}

View File

@ -358,6 +358,7 @@ declare global {
allTabViews: Map<string, WaveTabView>;
activeTabView: WaveTabView;
alreadyClosed: boolean;
deleteAllowed: boolean;
};
type WaveTabView = Electron.WebContentsView & {