From 3101ff143b558b132176cb2362df5a3792c99e6f Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 20 Jun 2024 02:47:27 -0700 Subject: [PATCH] refac: disable continuing with error message --- src/lib/components/chat/Chat.svelte | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 1fae824156..a60aef51ae 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/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