fix isSelectedProp for settings/calendars switches (#4589)

This commit is contained in:
alannnc authored and GitHub committed 2022-09-19 02:01:34 +00:00
1 parent 7d277ad89f
commit 6e71de7ca3
2 files changed
+3 -1

No files matched your search

@@ -12,6 +12,7 @@ export function CalendarSwitch(props: {
externalId: string;
title: string;
defaultSelected: boolean;
isSelected: boolean;
}) {
const { t } = useLocale();
@@ -69,7 +70,7 @@ export function CalendarSwitch(props: {
key={props.externalId}
name="enabled"
label={props.title}
defaultChecked={props.defaultSelected}
defaultChecked={props.isSelected}
onCheckedChange={(isOn: boolean) => {
mutation.mutate({ isOn });
}}
@@ -132,6 +132,7 @@ const CalendarsView = () => {
externalId={cal.externalId}
title={cal.name || "Nameless calendar"}
type={item.integration.type}
isSelected={cal.isSelected}
defaultSelected={cal.externalId === data?.destinationCalendar?.externalId}
/>
))}