diff --git a/src/main/index.ts b/src/main/index.ts index 4bac00a446..1925df8e45 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -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() diff --git a/src/main/window.ts b/src/main/window.ts index 2f98e3ae70..695bfc6a93 100644 --- a/src/main/window.ts +++ b/src/main/window.ts @@ -136,6 +136,14 @@ export const createMainWindow = () => { }) windows.mainWindow = window + + window.on("close", (event) => { + if (process.platform === "darwin") { + event.preventDefault() + window.hide() + } + }) + return window } diff --git a/src/renderer/src/modules/feed-column/category.tsx b/src/renderer/src/modules/feed-column/category.tsx index f543b647b1..d1125d87ea 100644 --- a/src/renderer/src/modules/feed-column/category.tsx +++ b/src/renderer/src/modules/feed-column/category.tsx @@ -194,7 +194,7 @@ function FeedCategoryImpl({ {!!unread && showUnreadCount && ( -
+
{unread}
)}