Skip to content

Commit 8b0e77a

Browse files
committed
fix: Fixed a bug where the article list could not be displayed.
1 parent 348fc18 commit 8b0e77a

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.changeset/purple-brooms-pay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"xlog": patch
3+
---
4+
5+
fix: Fixed a bug where the article list could not be displayed.

src/components/FeedList/useFeedData.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useEffect, useMemo } from "react";
22

33
import { useCharacterId } from "@/hooks/use-character-id";
4+
import type { GetFeedParams } from "@/queries/home";
45
import { useGetFeed } from "@/queries/home";
56
import { useGetPagesBySiteLite } from "@/queries/page";
67
import { debounce } from "@/utils/debounce";
@@ -33,10 +34,10 @@ export const useFeedData = (props: Props) => {
3334
visibility,
3435
limit,
3536
characterId: characterId ?? _characterId,
36-
daysInterval,
37-
searchKeyword,
38-
tags,
39-
}), [
37+
daysInterval: daysInterval ?? null,
38+
searchKeyword: searchKeyword ?? null,
39+
tags: tags ?? [],
40+
} as GetFeedParams), [
4041
type,
4142
handle,
4243
visibility,
@@ -47,7 +48,7 @@ export const useFeedData = (props: Props) => {
4748
tags,
4849
]);
4950

50-
const feed = type === "shorts" && characterId
51+
const feed = type === "shorts" && !!characterId
5152
? useGetPagesBySiteLite({ // Searching specific note by characterId
5253
characterId,
5354
visibility,

0 commit comments

Comments
 (0)