From 5ee909f687b07ac6a042296de3e68bb6c8d8f4b6 Mon Sep 17 00:00:00 2001 From: Abhimanyu Yadav <122007096+Abhi1992002@users.noreply.github.com> Date: Tue, 12 Nov 2024 10:13:15 +0530 Subject: [PATCH] =?UTF-8?q?fix:=20show=20error=20toast=20on=20Run=20failur?= =?UTF-8?q?e=20when=20inputs=20or=20credentials=20are=20i=E2=80=A6=20(#839?= =?UTF-8?q?1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: show error toast on Run failure when inputs or credentials are invalid * Remove supabase folder from tracking * revert supabase * remove toast --------- Co-authored-by: Avhimanyu <2023ebcs396@online.bits-pilani.ac.in> Co-authored-by: Aarushi <50577581+aarushik93@users.noreply.github.com> --- .../frontend/src/hooks/useAgentGraph.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/autogpt_platform/frontend/src/hooks/useAgentGraph.ts b/autogpt_platform/frontend/src/hooks/useAgentGraph.ts index 0140a07c550e..e8631dbe134a 100644 --- a/autogpt_platform/frontend/src/hooks/useAgentGraph.ts +++ b/autogpt_platform/frontend/src/hooks/useAgentGraph.ts @@ -415,10 +415,25 @@ export default function useAgentGraph( if (saveRunRequest.state === "error") { if (saveRunRequest.request === "save") { console.error("Error saving agent"); + toast({ + variant: "destructive", + title: `Error saving agent`, + duration: 2000, + }); } else if (saveRunRequest.request === "run") { + toast({ + variant: "destructive", + title: `Error saving&running agent`, + duration: 2000, + }); console.error(`Error saving&running agent`); } else if (saveRunRequest.request === "stop") { console.error(`Error stopping agent`); + toast({ + variant: "destructive", + title: `Error stopping agent`, + duration: 2000, + }); } // Reset request setSaveRunRequest({ @@ -443,6 +458,11 @@ export default function useAgentGraph( } else if (saveRunRequest.request === "run") { if (!validateNodes()) { console.error("Validation failed; aborting run"); + toast({ + title: "Invalid credentials or inputs", + variant: "destructive", + duration: 2000, + }); setSaveRunRequest({ request: "none", state: "none",