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>
This commit is contained in:
Nafees Nazik 2023-05-20 02:53:12 +05:30 committed by GitHub
parent 4fd2d80637
commit cd4882429d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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">