mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-03-02 04:02:13 +01:00
fix shutdown for auto-update (#1162)
This commit is contained in:
parent
bf8cc732af
commit
8dbe5749f8
@ -574,6 +574,20 @@ function makeAppMenu() {
|
||||
electron.Menu.setApplicationMenu(menu);
|
||||
}
|
||||
|
||||
function hideWindowWithCatch(window: WaveBrowserWindow) {
|
||||
if (window == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (window.isDestroyed()) {
|
||||
return;
|
||||
}
|
||||
window.hide();
|
||||
} catch (e) {
|
||||
console.log("error hiding window", e);
|
||||
}
|
||||
}
|
||||
|
||||
electronApp.on("window-all-closed", () => {
|
||||
if (getGlobalIsRelaunching()) {
|
||||
return;
|
||||
@ -598,7 +612,7 @@ electronApp.on("before-quit", (e) => {
|
||||
e.preventDefault();
|
||||
const allWindows = getAllWaveWindows();
|
||||
for (const window of allWindows) {
|
||||
window.hide();
|
||||
hideWindowWithCatch(window);
|
||||
}
|
||||
if (getIsWaveSrvDead()) {
|
||||
console.log("wavesrv is dead, quitting immediately");
|
||||
|
Loading…
Reference in New Issue
Block a user