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
This commit is contained in:
Debanjum Singh Solanky
2024-10-08 23:26:04 -07:00
parent dd770cf1b9
commit 13fb22f7e7

View File

@@ -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(
{},