Skip to content

Commit

Permalink
fix: [Chat] when status of chat is error & showStopGenerate, stop sig…
Browse files Browse the repository at this point in the history
…n should not show (#2422)
  • Loading branch information
YyumeiZhang authored Aug 19, 2024
1 parent 4de0ba7 commit 896e1b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/semi-ui/chat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { Locale } from "../locale/interface";
import { Button, Upload } from '../index';

const prefixCls = cssClasses.PREFIX;
const { CHAT_ALIGN, MODE, SEND_HOT_KEY } = strings;
const { CHAT_ALIGN, MODE, SEND_HOT_KEY, MESSAGE_STATUS } = strings;

class Chat extends BaseComponent<ChatProps, ChatState> {

Expand Down Expand Up @@ -283,7 +283,7 @@ class Chat extends BaseComponent<ChatProps, ChatState> {
const lastChat = chats.length > 0 && chats[chats.length - 1];
let disableSend = false;
if (lastChat && showStopGenerate) {
const lastChatOnGoing = lastChat.status && lastChat.status !== 'complete';
const lastChatOnGoing = lastChat.status && [MESSAGE_STATUS.LOADING, MESSAGE_STATUS.INCOMPLETE].includes(lastChat.status);
disableSend = lastChatOnGoing;
showStopGenerate && (showStopGenerateFlag = lastChatOnGoing);
}
Expand Down

0 comments on commit 896e1b8

Please sign in to comment.