Skip to content

Commit a92ef49

Browse files
committed
fix(stream): prevent request if no ids
Signed-off-by: Innei <tukon479@gmail.com>
1 parent 6320c00 commit a92ef49

File tree

1 file changed

+3
-1
lines changed
  • apps/renderer/src/modules/entry-column

1 file changed

+3
-1
lines changed

apps/renderer/src/modules/entry-column/hooks.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ function sortEntriesIdByEntryInsertedAt(entries: string[]) {
278278
)
279279
}
280280

281-
const useFetchEntryContentByStream = (remoteEntryIds: string[]) => {
281+
const useFetchEntryContentByStream = (remoteEntryIds?: string[]) => {
282282
const { mutate: updateEntryContent } = useMutation({
283283
mutationKey: ["stream-entry-content", remoteEntryIds],
284284
mutationFn: async (remoteEntryIds: string[]) => {
@@ -296,6 +296,8 @@ const useFetchEntryContentByStream = (remoteEntryIds: string[]) => {
296296
}
297297
}
298298

299+
if (nextIds.length === 0) return
300+
299301
const readStream = async () => {
300302
const response = await apiFetch(apiClient.entries.stream.$url().toString(), {
301303
method: "post",

0 commit comments

Comments
 (0)