fix isSelectedProp for settings/calendars switches (#4589)

pull/4594/head
alannnc 2022-09-19 02:01:34 +00:00 committed by GitHub
parent 7d277ad89f
commit 6e71de7ca3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -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 });
}}

View File

@ -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}
/>
))}