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 />
|
<DisableConfirm />
|
||||||
<DeleteConfirm />
|
<DeleteConfirm />
|
||||||
<Controller
|
<Controller
|
||||||
name="config.enabled[0]"
|
name="config.enabled"
|
||||||
defaultValue={["true"][0]}
|
defaultValue={["true"]}
|
||||||
control={control}
|
control={control}
|
||||||
render={({ field }) =>
|
render={({ field }) =>
|
||||||
!id ? (
|
!id ? (
|
||||||
|
@ -94,12 +94,12 @@ export const Header = ({
|
||||||
{t("deleteProvider")}
|
{t("deleteProvider")}
|
||||||
</DropdownItem>,
|
</DropdownItem>,
|
||||||
]}
|
]}
|
||||||
isEnabled={field.value === "true"}
|
isEnabled={field.value?.[0] === "true"}
|
||||||
onToggle={(value) => {
|
onToggle={(value) => {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
toggleDisableDialog();
|
toggleDisableDialog();
|
||||||
} else {
|
} else {
|
||||||
field.onChange(value.toString());
|
field.onChange([value.toString()]);
|
||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
Loading…
Reference in a new issue