1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-09-03 06:12:53 +02:00

fix: empty content check

This commit is contained in:
Arik Chakma
2025-05-22 20:09:44 +06:00
parent fc250a0a08
commit 2e248b1e6b

View File

@@ -382,7 +382,13 @@ export function RoadmapAIChat(props: RoadmapAIChatProps) {
return;
}
handleChatSubmit(editorRef.current?.getJSON() || {});
const json = editorRef.current?.getJSON();
if (!json || isEmptyContent(json)) {
toast.error('Please enter a message');
return;
}
handleChatSubmit(json);
}}
>
{isStreamingMessage ? (