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