diff --git a/src/main/index.ts b/src/main/index.ts index 9fe0e63..206a420 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -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) } })