mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-23 02:53:29 +00:00
Clear AI chat stream properly (#3544)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Clear AI chat properly
|
||||
@@ -187,6 +187,8 @@ export function useAIChatController(): AIChatController {
|
||||
for await (const data of stream) {
|
||||
if (!data) continue;
|
||||
|
||||
if (globalState.getState().state.query !== input.message) break; // Chat was cleared, stop processing the stream
|
||||
|
||||
const event = data.event;
|
||||
|
||||
switch (event.type) {
|
||||
|
||||
Reference in New Issue
Block a user