diff --git a/src/components/Chat/ChatContent/ChatContent.tsx b/src/components/Chat/ChatContent/ChatContent.tsx index abc7df9..a4a6eed 100644 --- a/src/components/Chat/ChatContent/ChatContent.tsx +++ b/src/components/Chat/ChatContent/ChatContent.tsx @@ -59,7 +59,9 @@ const ChatContent = () => { ref={saveRef} > - {messages?.length === 0 && } + {!generating && messages?.length === 0 && ( + + )} {messages?.map((message, index) => ( { content={message.content} messageIndex={index} /> - + {!generating && } ))} diff --git a/src/components/Chat/ChatContent/Message/MessageContent.tsx b/src/components/Chat/ChatContent/Message/MessageContent.tsx index e2888ff..89c4fad 100644 --- a/src/components/Chat/ChatContent/Message/MessageContent.tsx +++ b/src/components/Chat/ChatContent/Message/MessageContent.tsx @@ -369,7 +369,7 @@ const EditView = ({ }; const handleSave = () => { - if (sticky && _content === '') return; + if (sticky && (_content === '' || useStore.getState().generating)) return; const updatedChats: ChatInterface[] = JSON.parse( JSON.stringify(useStore.getState().chats) ); @@ -387,6 +387,7 @@ const EditView = ({ const { handleSubmit } = useSubmit(); const handleSaveAndSubmit = () => { + if (useStore.getState().generating) return; const updatedChats: ChatInterface[] = JSON.parse( JSON.stringify(useStore.getState().chats) ); @@ -481,13 +482,16 @@ const EditViewButtons = React.memo( _setContent: React.Dispatch>; }) => { const { t } = useTranslation(); + const generating = useStore.getState().generating; return ( {sticky && ( @@ -498,7 +502,11 @@ const EditViewButtons = React.memo( @@ -511,7 +519,7 @@ const EditViewButtons = React.memo( { - setIsModalOpen(true); + !generating && setIsModalOpen(true); }} >