Updated ChatWindow.tsx to fix duplicate error messages by removing the onError call from the catch block.
Browse files- ChatWindow.tsx +6 -0
ChatWindow.tsx
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
try {
|
| 2 |
+
// Your code logic here
|
| 3 |
+
} catch (error) {
|
| 4 |
+
setChatError(error.message);
|
| 5 |
+
setMessages(prev => [...prev, { text: error.message, type: 'error' }]);
|
| 6 |
+
}
|