try to fix macos start

This commit is contained in:
pompurin404 2024-08-14 18:47:47 +08:00
parent 478f9013fc
commit fc6b86fabc
No known key found for this signature in database

View File

@ -79,11 +79,13 @@ app.whenReady().then(async () => {
app.on('activate', function () { app.on('activate', function () {
// On macOS it's common to re-create a window in the app when the // On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open. // dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) { if (!mainWindow) {
if (destroyTimer) { if (destroyTimer) {
clearTimeout(destroyTimer) clearTimeout(destroyTimer)
} }
createWindow(true) createWindow(true)
} else {
showMainWindow()
} }
}) })
}) })