diff --git a/src/hooks/useStream.ts b/src/hooks/useStream.ts index 77e6a54..8c5800f 100644 --- a/src/hooks/useStream.ts +++ b/src/hooks/useStream.ts @@ -142,6 +142,14 @@ export const useStream = < ...queryOptions, queryKey, queryFn: async () => { + if (queryOptions.enabled === false) { + // If the query is disabled, early return empty response + return { + done: true, + responses: [], + }; + } + let responses: O[] = []; const streamId = streamIdRef.current; streamIdRef.current += 1;