From 13fb22f7e7e601c3fcfc50b43275a53c14928124 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Tue, 8 Oct 2024 23:26:04 -0700 Subject: [PATCH] Update agent form data shown in edit card after save operaton on web app Previously you had to refresh the page to see the updated data on reopening the agents edit card after a save operation. Now you see the latest saved agent data on reopening the agents edit card. This should avoid confusion on whether the data was saved correctly --- src/interface/web/app/agents/page.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/interface/web/app/agents/page.tsx b/src/interface/web/app/agents/page.tsx index 30d360e3..332ac0d2 100644 --- a/src/interface/web/app/agents/page.tsx +++ b/src/interface/web/app/agents/page.tsx @@ -230,6 +230,20 @@ function AgentCard(props: AgentCardProps) { }, }); + useEffect(() => { + form.reset({ + name: props.data.name, + persona: props.data.persona, + color: props.data.color, + icon: props.data.icon, + privacy_level: props.data.privacy_level, + chat_model: props.data.chat_model, + files: props.data.files, + input_tools: props.data.input_tools, + output_modes: props.data.output_modes, + }); + }, [props.data]); + if (showModal) { window.history.pushState( {},