mirror of
https://github.com/NovaOSS/nova-betterchat.git
synced 2024-11-25 22:53:59 +01:00
parent
4fa5c14734
commit
7a7db911c5
|
@ -65,17 +65,7 @@ const ChatContent = () => {
|
|||
</div>
|
||||
)}
|
||||
|
||||
<div className='text-center mt-6 flex justify-center gap-2'>
|
||||
<button
|
||||
className='btn relative btn-primary mt-2'
|
||||
onClick={() => {
|
||||
handleSubmit();
|
||||
}}
|
||||
>
|
||||
Submit
|
||||
</button>
|
||||
</div>
|
||||
<div className='w-full h-10'></div>
|
||||
<div className='w-full h-36'></div>
|
||||
</div>
|
||||
</ScrollToBottom>
|
||||
</div>
|
||||
|
|
|
@ -326,7 +326,7 @@ const EditView = ({
|
|||
};
|
||||
|
||||
const handleSave = () => {
|
||||
if (_content === '') return;
|
||||
if (sticky && _content === '') return;
|
||||
const updatedChats: ChatInterface[] = JSON.parse(
|
||||
JSON.stringify(useStore.getState().chats)
|
||||
);
|
||||
|
@ -344,13 +344,14 @@ const EditView = ({
|
|||
|
||||
const { handleSubmit } = useSubmit();
|
||||
const handleSaveAndSubmit = () => {
|
||||
if (_content == '') return;
|
||||
const updatedChats: ChatInterface[] = JSON.parse(
|
||||
JSON.stringify(useStore.getState().chats)
|
||||
);
|
||||
const updatedMessages = updatedChats[currentChatIndex].messages;
|
||||
if (sticky) {
|
||||
updatedMessages.push({ role: inputRole, content: _content });
|
||||
if (_content !== '') {
|
||||
updatedMessages.push({ role: inputRole, content: _content });
|
||||
}
|
||||
_setContent('');
|
||||
resetTextAreaHeight();
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue