use array instead of first (#20964)
* use array instead of first fixes: #19638 * pr review
This commit is contained in:
parent
4d84725d28
commit
39e3820e9e
1 changed files with 4 additions and 4 deletions
|
@ -69,8 +69,8 @@ export const Header = ({
|
|||
<DisableConfirm />
|
||||
<DeleteConfirm />
|
||||
<Controller
|
||||
name="config.enabled[0]"
|
||||
defaultValue={["true"][0]}
|
||||
name="config.enabled"
|
||||
defaultValue={["true"]}
|
||||
control={control}
|
||||
render={({ field }) =>
|
||||
!id ? (
|
||||
|
@ -94,12 +94,12 @@ export const Header = ({
|
|||
{t("deleteProvider")}
|
||||
</DropdownItem>,
|
||||
]}
|
||||
isEnabled={field.value === "true"}
|
||||
isEnabled={field.value?.[0] === "true"}
|
||||
onToggle={(value) => {
|
||||
if (!value) {
|
||||
toggleDisableDialog();
|
||||
} else {
|
||||
field.onChange(value.toString());
|
||||
field.onChange([value.toString()]);
|
||||
save();
|
||||
}
|
||||
}}
|
||||
|
|
Loading…
Reference in a new issue