diff --git a/apps/renderer/src/modules/timeline-column/ListFeedList.tsx b/apps/renderer/src/modules/timeline-column/ListFeedList.tsx index 2786a781b..b6aa86caf 100644 --- a/apps/renderer/src/modules/timeline-column/ListFeedList.tsx +++ b/apps/renderer/src/modules/timeline-column/ListFeedList.tsx @@ -12,6 +12,7 @@ import { useTranslation } from "react-i18next" import { useNavigateEntry } from "~/hooks/biz/useNavigateEntry" import { useRouteParamsSelector } from "~/hooks/biz/useRouteParams" +import { useList } from "~/queries/lists" import { useFeedById } from "~/store/feed" import { useListById } from "~/store/list" @@ -21,7 +22,9 @@ import { feedColumnStyles } from "./styles" export const ListFeedList: FC<{ listId: string }> = ({ listId }) => { const { t } = useTranslation() - const list = useListById(listId) + const cachedList = useListById(listId) + const res = useList({ id: listId, noExtras: true }) + const list = res.data?.list || cachedList const currentFeedId = useRouteParamsSelector((s) => s.feedId) if (!list) return null diff --git a/apps/renderer/src/queries/lists.ts b/apps/renderer/src/queries/lists.ts index b7475a4b7..3f3cab7e2 100644 --- a/apps/renderer/src/queries/lists.ts +++ b/apps/renderer/src/queries/lists.ts @@ -7,13 +7,13 @@ export const lists = { defineQuery(["lists"], async () => listActions.fetchOwnedLists(), { rootKey: ["lists"], }), - byId: ({ id }: { id: string }) => - defineQuery(["lists", id], async () => listActions.fetchListById(id), { + byId: ({ id, noExtras }: { id: string; noExtras?: boolean }) => + defineQuery(["lists", id, noExtras], async () => listActions.fetchListById(id, noExtras), { rootKey: ["lists"], }), } -export const useList = ({ id }: { id?: string }) => - useAuthQuery(lists.byId({ id: id! }), { +export const useList = ({ id, noExtras }: { id?: string; noExtras?: boolean }) => + useAuthQuery(lists.byId({ id: id!, noExtras }), { enabled: !!id, }) diff --git a/apps/renderer/src/store/list/store.ts b/apps/renderer/src/store/list/store.ts index 9b58c3834..cfcf68d78 100644 --- a/apps/renderer/src/store/list/store.ts +++ b/apps/renderer/src/store/list/store.ts @@ -112,8 +112,8 @@ class ListActionStatic { await tx.run() } - async fetchListById(id: string) { - const res = await apiClient.lists.$get({ query: { listId: id } }) + async fetchListById(id: string, noExtras?: boolean) { + const res = await apiClient.lists.$get({ query: { listId: id, noExtras } }) this.upsertMany([res.data.list]) return res.data diff --git a/packages/shared/src/hono.ts b/packages/shared/src/hono.ts index bcd635b41..57a2b2fa2 100644 --- a/packages/shared/src/hono.ts +++ b/packages/shared/src/hono.ts @@ -15810,6 +15810,7 @@ declare const _routes: hono_hono_base.HonoBase