fix: impersonation switch active state (#8924)
* fix: switch * fix: checked --------- Co-authored-by: Hariom Balhara <hariombalhara@gmail.com> Co-authored-by: alannnc <alannnc@gmail.com>pull/8903/head^2
parent
4fd2d80637
commit
cd4882429d
|
@ -50,6 +50,7 @@ const ProfileImpersonationView = () => {
|
|||
setValue,
|
||||
reset,
|
||||
getValues,
|
||||
watch,
|
||||
} = formMethods;
|
||||
|
||||
const isDisabled = isSubmitting || !isDirty;
|
||||
|
@ -63,11 +64,11 @@ const ProfileImpersonationView = () => {
|
|||
}}>
|
||||
<div className="flex space-x-3">
|
||||
<Switch
|
||||
defaultChecked={!user?.disableImpersonation}
|
||||
onCheckedChange={(e) => {
|
||||
setValue("disableImpersonation", !e, { shouldDirty: true });
|
||||
}}
|
||||
fitToHeight={true}
|
||||
checked={!watch("disableImpersonation")}
|
||||
/>
|
||||
<div className="flex flex-col">
|
||||
<Skeleton as={Label} className="text-emphasis text-sm font-semibold leading-none">
|
||||
|
|
Loading…
Reference in New Issue