Skip to content

Commit a72d491

Browse files
committed
fix
1 parent 78b8f98 commit a72d491

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/xl-ai/src/components/BlockNoteAIContext.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ export function BlockNoteAIContextProvider(
9999
}
100100
ret = await llm.markdown.call(editor, { model, ...options });
101101
}
102-
setAIResponseStatus("done");
102+
// if the menu has been closed already, don't set it to done
103+
if (aiMenuBlockID !== undefined) {
104+
setAIResponseStatus("done");
105+
}
103106
return ret;
104107
} catch (e) {
105108
setAIResponseStatus("initial");
@@ -108,7 +111,7 @@ export function BlockNoteAIContextProvider(
108111
console.error(e);
109112
}
110113
},
111-
[model, dataFormat, stream, editor]
114+
[model, dataFormat, stream, editor, aiMenuBlockID]
112115
);
113116

114117
// TODO: Revisit - this pattern might be a bit iffy

0 commit comments

Comments
 (0)