Skip to content

Commit

Permalink
fix: unread all action
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Jul 4, 2024
1 parent 2ae11fa commit 7f4fc06
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/renderer/src/lib/shortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const shortcuts = {
},
markAllAsRead: {
name: "Mark All as Read",
key: "A",
key: "Shift+Meta+A",
},
toggleUnreadOnly: {
name: "Toggle Unread Only",
Expand All @@ -62,11 +62,11 @@ export const shortcuts = {
},
copyLink: {
name: "Copy Link",
key: "Meta+Shift+C",
key: "Shift+Meta+C",
},
tip: {
name: "Tip Power",
key: "Meta+Shift+T",
key: "Shift+Meta+T",
},
},
} as const
20 changes: 16 additions & 4 deletions src/renderer/src/modules/entry-column/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ import {
useRouteParms,
} from "@renderer/hooks/biz/useRouteParams"
import { apiClient } from "@renderer/lib/api-fetch"
import { ROUTE_ENTRY_PENDING, ROUTE_FEED_PENDING, views } from "@renderer/lib/constants"
import {
ROUTE_ENTRY_PENDING,
ROUTE_FEED_PENDING,
views,
} from "@renderer/lib/constants"
import { getStorageNS } from "@renderer/lib/ns"
import { shortcuts } from "@renderer/lib/shortcuts"
import { cn, getEntriesParams, getOS, isBizId } from "@renderer/lib/utils"
Expand Down Expand Up @@ -270,7 +274,10 @@ const ListHeader: FC<{
},
})

if (typeof routerParams.feedId === "number") {
if (
typeof routerParams.feedId === "number" ||
routerParams.feedId === ROUTE_FEED_PENDING
) {
subscriptionActions.markReadByView(routerParams.view)
} else {
routerParams.feedId?.split(",").forEach((feedId) => {
Expand Down Expand Up @@ -319,8 +326,13 @@ const ListHeader: FC<{
)}
>
{!titleAtBottom && titleInfo}
<div className="relative z-[1] flex items-center gap-1 self-baseline text-zinc-500" onClick={(e) => e.stopPropagation()}>
{views[view].wideMode && entryId && entryId !== ROUTE_ENTRY_PENDING && (
<div
className="relative z-[1] flex items-center gap-1 self-baseline text-zinc-500"
onClick={(e) => e.stopPropagation()}
>
{views[view].wideMode &&
entryId &&
entryId !== ROUTE_ENTRY_PENDING && (
<>
<EntryHeader view={view} entryId={entryId} />
<DividerVertical className="w-px" />
Expand Down

0 comments on commit 7f4fc06

Please sign in to comment.