1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-15 15:47:42 +08:00

Opt: Use callback instead of timeout when closing window

This commit is contained in:
LmeSzinc
2022-01-11 21:02:00 +08:00
parent 9360601e8e
commit 0413c747a2
2 changed files with 5 additions and 4 deletions

View File

@@ -102,8 +102,9 @@ const createWindow = async () => {
mainWindow?.isMaximized() ? mainWindow?.restore() : mainWindow?.maximize();
});
ipcMain.on('window-close', function () {
alas.kill();
setTimeout(() => mainWindow?.close(), 500); // Wait taskkill to finish
alas.kill(function () {
mainWindow?.close();
})
});
// Tray