Skip to content

Commit

Permalink
fix: remove persistence error toast and improve error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
vgcman16 committed Oct 30, 2024
1 parent 895fb7a commit 02030cb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/components/chat/Chat.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { Message } from 'ai';
import { useChat } from 'ai/react';
import { useAnimate } from 'framer-motion';
import { memo, useEffect, useRef, useState } from 'react';
import { cssTransition, toast, ToastContainer } from 'react-toastify';
import { cssTransition, ToastContainer } from 'react-toastify';
import { useMessageParser, usePromptEnhancer, useShortcuts, useSnapScroll } from '~/lib/hooks';
import { useChatHistory } from '~/lib/persistence';
import { chatStore } from '~/lib/stores/chat';
Expand Down Expand Up @@ -80,7 +80,6 @@ export const ChatImpl = memo(({ initialMessages, storeMessageHistory }: ChatProp
api: '/api/chat',
onError: (error) => {
logger.error('Request failed\n\n', error);
toast.error('There was an error processing your request');
},
onFinish: () => {
logger.debug('Finished streaming');
Expand All @@ -103,7 +102,6 @@ export const ChatImpl = memo(({ initialMessages, storeMessageHistory }: ChatProp
if (messages.length > initialMessages.length) {
storeMessageHistory(messages).catch((error) => {
logger.error('Failed to store message history:', error);
// Don't show error toast for persistence failures
});
}
}, [messages, isLoading, parseMessages, storeMessageHistory, initialMessages.length]);
Expand Down

0 comments on commit 02030cb

Please sign in to comment.