diff --git a/src/renderer/src/lib/route-builder.test.ts b/src/renderer/src/lib/route-builder.test.ts index 875c4129a1..7af1c1885f 100644 --- a/src/renderer/src/lib/route-builder.test.ts +++ b/src/renderer/src/lib/route-builder.test.ts @@ -118,7 +118,7 @@ describe("test route builder", () => { "children": [ { "handle": { - "fs": "./pages/(external)/(with-layout)/feed/[:id]/index/", + "fs": "./pages/(external)/(with-layout)/feed/[id]/index/", "fullPath": "/feed/:id/", }, "lazy": [Function], @@ -126,7 +126,7 @@ describe("test route builder", () => { }, ], "handle": { - "fs": "./pages/(external)/(with-layout)/feed/[:id]/layout", + "fs": "./pages/(external)/(with-layout)/feed/[id]/layout", "fullPath": "/feed/:id", }, "lazy": [Function], @@ -134,7 +134,7 @@ describe("test route builder", () => { }, ], "handle": { - "fs": "./pages/(external)/(with-layout)/feed/[:id]/:id", + "fs": "./pages/(external)/(with-layout)/feed/[id]/:id", "fullPath": "/feed/:id", }, "path": ":id", diff --git a/src/renderer/src/modules/entry-column/item.tsx b/src/renderer/src/modules/entry-column/item.tsx index 8686d42b44..51edd67e14 100644 --- a/src/renderer/src/modules/entry-column/item.tsx +++ b/src/renderer/src/modules/entry-column/item.tsx @@ -1,6 +1,6 @@ import { useAsRead, useBizQuery, useEntryActions } from "@renderer/hooks" import { useNavigateEntry } from "@renderer/hooks/biz/useNavigateEntry" -import { useRouteEntryId } from "@renderer/hooks/biz/useRouteParams" +import { useRouteParamsSelector } from "@renderer/hooks/biz/useRouteParams" import { views } from "@renderer/lib/constants" import { FeedViewType } from "@renderer/lib/enum" import { showNativeMenu } from "@renderer/lib/native-menu" @@ -41,7 +41,7 @@ function EntryItemImpl({ entry, view }: { entry: EntryModel, view?: number }) { }, ) - const currentEntryId = useRouteEntryId() + const isActive = useRouteParamsSelector(({ entryId }) => entryId === entry.entries.id) const asRead = useAsRead(entry) @@ -120,7 +120,7 @@ function EntryItemImpl({ entry, view }: { entry: EntryModel, view?: number }) { className={cn( "rounded-md bg-theme-background transition-colors", !views[view || 0].wideMode && - currentEntryId === entry.entries.id && + isActive && "bg-theme-item-active", asRead ? "text-zinc-500/90" : "text-zinc-900 dark:text-white/90", )}