-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Overlay calendar - enabled by default if supported calendar installed #15500
base: main
Are you sure you want to change the base?
Conversation
@anikdhabal is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
Graphite Automations"Add community label" took an action on this PR • (06/19/24)1 label was added to this PR based on Keith Williams's automation. "Add consumer team as reviewer" took an action on this PR • (06/19/24)1 reviewer was added to this PR based on Keith Williams's automation. |
@@ -140,7 +144,16 @@ const BookerComponent = ({ | |||
scrolledToTimeslotsOnce.current = true; | |||
} | |||
}; | |||
|
|||
useEffect(() => { | |||
if (connectedCalendars.length > 0 && hasSession) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'connectedCalendars' are passed by the 'calendars' prop, which is passed to 'Booker' by the 'BookerWebWrapper', which gets the 'calendars' using 'useCalendars' hook.
However, if we check 'useCalendars' hook, then fetching connected calendars is enabled only if the setting is set in state or 'overlayCalendar' exists as search param:
const { data, isPending } = trpc.viewer.connectedCalendars.useQuery(undefined, {
enabled: !!calendarSettingsOverlay || Boolean(searchParams?.get("overlayCalendar")),
});
But the newly added useEffect
only sets 'overlayCalendar' to true, if there are connected calendars, so we have a closed circle - I tried testing this PR and even though I have connected a calendar visiting someone's booking page did nothing.
What does this PR do?
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Checklist