Skip to content

Scheduling infrastructure for absolutely everyone.

fix isSelectedProp for settings/calendars switches (#4589)

alannnc6e71de7ca37c
diff --git a/apps/web/components/v2/settings/CalendarSwitch.tsx b/apps/web/components/v2/settings/CalendarSwitch.tsx
index 5cf5f1a32ac..0051422700b 100644
--- a/apps/web/components/v2/settings/CalendarSwitch.tsx
+++ b/apps/web/components/v2/settings/CalendarSwitch.tsx
@@ -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 });
}}
diff --git a/apps/web/pages/v2/settings/my-account/calendars.tsx b/apps/web/pages/v2/settings/my-account/calendars.tsx
index b4bf5a28634..cd1e173cb37 100644
--- a/apps/web/pages/v2/settings/my-account/calendars.tsx
+++ b/apps/web/pages/v2/settings/my-account/calendars.tsx
@@ -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}
/>
))}