style: error message + move stream to try block

This commit is contained in:
Jing Hua 2023-03-07 23:57:27 +08:00
parent 9fedb3f169
commit ae9499301a
2 changed files with 3 additions and 3 deletions

View file

@ -68,8 +68,8 @@ const ChatContent = () => {
/>
{error !== '' && (
<div className='relative bg-red-600/50 p-2 rounded-sm w-3/5 mt-3 max-md:w-11/12'>
<div className='text-gray-900 dark:text-gray-300 text-sm whitespace-pre-line'>
<div className='relative py-2 px-3 w-3/5 mt-3 max-md:w-11/12 border rounded-md border-red-500 bg-red-500/10'>
<div className='text-gray-600 dark:text-gray-100 text-sm whitespace-pre-line'>
{error}
</div>
<div

View file

@ -29,9 +29,9 @@ const useSubmit = () => {
setChats(updatedChats);
setGenerating(true);
let stream;
try {
let stream;
const messages = limitMessageTokens(
chats[currentChatIndex].messages,
4000