Skip to content

Commit d9bc62b

Browse files
committed
feat: get full list feeds
1 parent e8e3851 commit d9bc62b

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

apps/renderer/src/modules/timeline-column/ListFeedList.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { useTranslation } from "react-i18next"
1212

1313
import { useNavigateEntry } from "~/hooks/biz/useNavigateEntry"
1414
import { useRouteParamsSelector } from "~/hooks/biz/useRouteParams"
15+
import { useList } from "~/queries/lists"
1516
import { useFeedById } from "~/store/feed"
1617
import { useListById } from "~/store/list"
1718

@@ -21,7 +22,9 @@ import { feedColumnStyles } from "./styles"
2122

2223
export const ListFeedList: FC<{ listId: string }> = ({ listId }) => {
2324
const { t } = useTranslation()
24-
const list = useListById(listId)
25+
const cachedList = useListById(listId)
26+
const res = useList({ id: listId, noExtras: true })
27+
const list = res.data?.list || cachedList
2528
const currentFeedId = useRouteParamsSelector((s) => s.feedId)
2629

2730
if (!list) return null

apps/renderer/src/queries/lists.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ export const lists = {
77
defineQuery(["lists"], async () => listActions.fetchOwnedLists(), {
88
rootKey: ["lists"],
99
}),
10-
byId: ({ id }: { id: string }) =>
11-
defineQuery(["lists", id], async () => listActions.fetchListById(id), {
10+
byId: ({ id, noExtras }: { id: string; noExtras?: boolean }) =>
11+
defineQuery(["lists", id, noExtras], async () => listActions.fetchListById(id, noExtras), {
1212
rootKey: ["lists"],
1313
}),
1414
}
1515

16-
export const useList = ({ id }: { id?: string }) =>
17-
useAuthQuery(lists.byId({ id: id! }), {
16+
export const useList = ({ id, noExtras }: { id?: string; noExtras?: boolean }) =>
17+
useAuthQuery(lists.byId({ id: id!, noExtras }), {
1818
enabled: !!id,
1919
})

apps/renderer/src/store/list/store.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ class ListActionStatic {
112112
await tx.run()
113113
}
114114

115-
async fetchListById(id: string) {
116-
const res = await apiClient.lists.$get({ query: { listId: id } })
115+
async fetchListById(id: string, noExtras?: boolean) {
116+
const res = await apiClient.lists.$get({ query: { listId: id, noExtras } })
117117

118118
this.upsertMany([res.data.list])
119119
return res.data

packages/shared/src/hono.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15810,6 +15810,7 @@ declare const _routes: hono_hono_base.HonoBase<Env, ({
1581015810
input: {
1581115811
query: {
1581215812
listId: string;
15813+
noExtras?: boolean | undefined;
1581315814
};
1581415815
};
1581515816
output: {

0 commit comments

Comments
 (0)