mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00:30 +08:00
auto destroy window
This commit is contained in:
parent
f8062e3251
commit
7e30114ef2
@ -159,6 +159,14 @@ export function createWindow(show = false): void {
|
|||||||
if (!silentStart || show) {
|
if (!silentStart || show) {
|
||||||
mainWindow?.show()
|
mainWindow?.show()
|
||||||
mainWindow?.focusOnWebView()
|
mainWindow?.focusOnWebView()
|
||||||
|
} else {
|
||||||
|
if (destroyTimer) {
|
||||||
|
clearTimeout(destroyTimer)
|
||||||
|
}
|
||||||
|
destroyTimer = setTimeout(() => {
|
||||||
|
mainWindow?.destroy()
|
||||||
|
mainWindow = null
|
||||||
|
}, 300000)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user