mirror of
https://github.com/hexastack/hexabot
synced 2025-02-22 20:38:32 +00:00
Merge pull request #340 from Hexastack/338-issue-context-var-edit-dialog-issue
fix(frontend): contextVar edit dialog states
This commit is contained in:
commit
3b33dd4bd9
@ -66,7 +66,11 @@ export const ContextVarDialog: FC<ContextVarDialogProps> = ({
|
|||||||
formState: { errors },
|
formState: { errors },
|
||||||
control,
|
control,
|
||||||
} = useForm<IContextVarAttributes>({
|
} = useForm<IContextVarAttributes>({
|
||||||
defaultValues: { name: data?.name || "", label: data?.label || "" },
|
defaultValues: {
|
||||||
|
name: data?.name || "",
|
||||||
|
label: data?.label || "",
|
||||||
|
permanent: data?.permanent || false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const validationRules = {
|
const validationRules = {
|
||||||
label: {
|
label: {
|
||||||
@ -96,6 +100,7 @@ export const ContextVarDialog: FC<ContextVarDialogProps> = ({
|
|||||||
reset({
|
reset({
|
||||||
label: data.label,
|
label: data.label,
|
||||||
name: data.name,
|
name: data.name,
|
||||||
|
permanent: data.permanent,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
reset();
|
reset();
|
||||||
|
Loading…
Reference in New Issue
Block a user