fix: don't close renderer process on darwin

Signed-off-by: Innei <i@innei.in>
This commit is contained in:
Innei 2024-07-24 19:37:19 +08:00
parent f2b6a2f50b
commit 707bf01f59
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
3 changed files with 16 additions and 1 deletions

View File

@ -55,6 +55,8 @@ function bootsharp() {
if (BrowserWindow.getAllWindows().length === 0) {
mainWindow = createMainWindow()
}
if (mainWindow) mainWindow.show()
})
app.on("open-url", (_, url) => {
@ -140,6 +142,11 @@ function bootsharp() {
app.quit()
}
})
app.on("before-quit", () => {
const windows = BrowserWindow.getAllWindows()
windows.forEach((window) => window.destroy())
})
}
bootsharp()

View File

@ -136,6 +136,14 @@ export const createMainWindow = () => {
})
windows.mainWindow = window
window.on("close", (event) => {
if (process.platform === "darwin") {
event.preventDefault()
window.hide()
}
})
return window
}

View File

@ -194,7 +194,7 @@ function FeedCategoryImpl({
</span>
</div>
{!!unread && showUnreadCount && (
<div className="ml-2 text-xs text-zinc-500 dark:text-neutral-400">
<div className="ml-2 text-xs tabular-nums text-zinc-500 dark:text-neutral-400">
{unread}
</div>
)}