mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-22 16:48:23 +01:00
make sure the user affirmatively acknowledged window deletion before deleting, fix for #1167 (#1181)
This commit is contained in:
parent
e10bcee05a
commit
48001ee734
@ -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);
|
||||
}
|
||||
|
1
frontend/types/custom.d.ts
vendored
1
frontend/types/custom.d.ts
vendored
@ -358,6 +358,7 @@ declare global {
|
||||
allTabViews: Map<string, WaveTabView>;
|
||||
activeTabView: WaveTabView;
|
||||
alreadyClosed: boolean;
|
||||
deleteAllowed: boolean;
|
||||
};
|
||||
|
||||
type WaveTabView = Electron.WebContentsView & {
|
||||
|
Loading…
Reference in New Issue
Block a user