Ignore new message when the current message is not finished yet
This commit is contained in:
@@ -8,13 +8,14 @@ import { ModelSelect } from "./ModelSelect";
|
||||
interface Props {
|
||||
model: OpenAIModel;
|
||||
messages: Message[];
|
||||
messageIsStreaming: boolean,
|
||||
loading: boolean;
|
||||
lightMode: "light" | "dark";
|
||||
onSend: (message: Message) => void;
|
||||
onSelect: (model: OpenAIModel) => void;
|
||||
}
|
||||
|
||||
export const Chat: FC<Props> = ({ model, messages, loading, lightMode, onSend, onSelect }) => {
|
||||
export const Chat: FC<Props> = ({ model, messages, messageIsStreaming, loading, lightMode, onSend, onSelect }) => {
|
||||
const messagesEndRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
const scrollToBottom = () => {
|
||||
@@ -57,7 +58,7 @@ export const Chat: FC<Props> = ({ model, messages, loading, lightMode, onSend, o
|
||||
</div>
|
||||
|
||||
<div className="h-[80px] sm:h-[140px] w-[340px] sm:w-[400px] md:w-[500px] lg:w-[700px] xl:w-[800px] mx-auto">
|
||||
<ChatInput onSend={onSend} />
|
||||
<ChatInput messageIsStreaming={messageIsStreaming} onSend={onSend} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user