[WEB-5657] chore: synchronization configuration for multiple providers in authentication adapter #8409

This commit is contained in:
b-saikrishnakanth 2025-12-22 12:55:19 +05:30 committed by GitHub
parent c2ce21e56c
commit 46453560f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -26,13 +26,11 @@ export function ControllerSwitch<T extends FieldValues>(props: Props<T>) {
<Controller <Controller
control={control} control={control}
name={name as FieldPath<T>} name={name as FieldPath<T>}
render={({ field: { value, onChange } }) => ( render={({ field: { value, onChange } }) => {
<ToggleSwitch const parsedValue = Number.parseInt(typeof value === "string" ? value : String(value ?? "0"), 10);
value={Boolean(parseInt(value))} const isOn = !Number.isNaN(parsedValue) && parsedValue !== 0;
onChange={() => (parseInt(value) ? onChange("0") : onChange("1"))} return <ToggleSwitch value={isOn} onChange={() => onChange(isOn ? "0" : "1")} size="sm" />;
size="sm" }}
/>
)}
/> />
</div> </div>
</div> </div>