Jelajahi Sumber

refac: disable continuing with error message

Timothy J. Baek 10 bulan lalu
induk
melakukan
3101ff143b
1 mengubah file dengan 7 tambahan dan 0 penghapusan
  1. 7 0
      src/lib/components/chat/Chat.svelte

+ 7 - 0
src/lib/components/chat/Chat.svelte

@@ -323,6 +323,13 @@
 		} else if (messages.length != 0 && messages.at(-1).done != true) {
 			// Response not done
 			console.log('wait');
+		} else if (messages.length != 0 && messages.at(-1).error) {
+			// Error in response
+			toast.error(
+				$i18n.t(
+					`Oops! There was an error in the previous response. Please try again or contact admin.`
+				)
+			);
 		} else if (
 			files.length > 0 &&
 			files.filter((file) => file.type !== 'image' && file.status !== 'processed').length > 0