Просмотр исходного кода

do nothing when the input is empty

Yuki Takei 1 год назад
Родитель
Сommit
53462c7bde

+ 5 - 0
apps/app/src/features/openai/chat/components/AiChatModal/AiChatModal.tsx

@@ -75,6 +75,11 @@ const AiChatModalSubstance = (): JSX.Element => {
       return;
     }
 
+    // do nothing when the input is empty
+    if (data.input.trim().length === 0) {
+      return;
+    }
+
     const { length: logLength } = messageLogs;
 
     // add user message to the logs