Skip to content

Commit

Permalink
fix: don't close renderer process on darwin
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <[email protected]>
  • Loading branch information
Innei committed Jul 24, 2024
1 parent f2b6a2f commit 707bf01
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ function bootsharp() {
if (BrowserWindow.getAllWindows().length === 0) {
mainWindow = createMainWindow()
}

if (mainWindow) mainWindow.show()
})

app.on("open-url", (_, url) => {
Expand Down Expand Up @@ -140,6 +142,11 @@ function bootsharp() {
app.quit()
}
})

app.on("before-quit", () => {
const windows = BrowserWindow.getAllWindows()
windows.forEach((window) => window.destroy())
})
}

bootsharp()
8 changes: 8 additions & 0 deletions src/main/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ export const createMainWindow = () => {
})

windows.mainWindow = window

window.on("close", (event) => {
if (process.platform === "darwin") {
event.preventDefault()
window.hide()
}
})

return window
}

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/modules/feed-column/category.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
)}
Expand Down

0 comments on commit 707bf01

Please sign in to comment.