mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
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:
@@ -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(
|
||||
{},
|
||||
|
||||
Reference in New Issue
Block a user