Skip to content

Commit 8d82415

Browse files
committed
Fix
1 parent e2029e6 commit 8d82415

File tree

1 file changed

+7
-0
lines changed
  • apps/sim/app/workspace/[workspaceId]/home/hooks

1 file changed

+7
-0
lines changed

apps/sim/app/workspace/[workspaceId]/home/hooks/use-chat.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,6 +1069,13 @@ export function useChat(
10691069
})
10701070

10711071
const stopGeneration = useCallback(async () => {
1072+
if (sendingRef.current && !chatIdRef.current) {
1073+
const start = Date.now()
1074+
while (!chatIdRef.current && sendingRef.current && Date.now() - start < 3000) {
1075+
await new Promise((r) => setTimeout(r, 50))
1076+
}
1077+
}
1078+
10721079
if (sendingRef.current) {
10731080
await persistPartialResponse()
10741081
}

0 commit comments

Comments
 (0)