From 02030cb87594517b4eb53d6efb6cf97440541f1d Mon Sep 17 00:00:00 2001 From: Dustin <155417613+vgcman16@users.noreply.github.com> Date: Wed, 30 Oct 2024 18:01:57 -0500 Subject: [PATCH] fix: remove persistence error toast and improve error handling --- app/components/chat/Chat.client.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/components/chat/Chat.client.tsx b/app/components/chat/Chat.client.tsx index c5d0dbeed..a5d2ca786 100644 --- a/app/components/chat/Chat.client.tsx +++ b/app/components/chat/Chat.client.tsx @@ -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'; @@ -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'); @@ -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]);