Skip to content

Commit 7e30114

Browse files
author
pompurin404
committed
auto destroy window
1 parent f8062e3 commit 7e30114

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/index.ts

+8
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,14 @@ export function createWindow(show = false): void {
159159
if (!silentStart || show) {
160160
mainWindow?.show()
161161
mainWindow?.focusOnWebView()
162+
} else {
163+
if (destroyTimer) {
164+
clearTimeout(destroyTimer)
165+
}
166+
destroyTimer = setTimeout(() => {
167+
mainWindow?.destroy()
168+
mainWindow = null
169+
}, 300000)
162170
}
163171
})
164172

0 commit comments

Comments
 (0)