From 2e248b1e6b0269278a93370877c95ba6179dcf93 Mon Sep 17 00:00:00 2001 From: Arik Chakma Date: Thu, 22 May 2025 20:09:44 +0600 Subject: [PATCH] fix: empty content check --- src/components/RoadmapAIChat/RoadmapAIChat.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/RoadmapAIChat/RoadmapAIChat.tsx b/src/components/RoadmapAIChat/RoadmapAIChat.tsx index 35b6f5603..0f84f8a82 100644 --- a/src/components/RoadmapAIChat/RoadmapAIChat.tsx +++ b/src/components/RoadmapAIChat/RoadmapAIChat.tsx @@ -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 ? (