auto destroy window

This commit is contained in:
pompurin404 2024-08-14 13:28:30 +08:00
parent f8062e3251
commit 7e30114ef2
No known key found for this signature in database

View File

@ -159,6 +159,14 @@ export function createWindow(show = false): void {
if (!silentStart || show) {
mainWindow?.show()
mainWindow?.focusOnWebView()
} else {
if (destroyTimer) {
clearTimeout(destroyTimer)
}
destroyTimer = setTimeout(() => {
mainWindow?.destroy()
mainWindow = null
}, 300000)
}
})