poc - cal.com integration in onboarding flow (#12530)
This commit is contained in:
@ -2,6 +2,7 @@ import { useClientConfig } from '@/client-config/hooks/useClientConfig';
|
||||
import { apiConfigState } from '@/client-config/states/apiConfigState';
|
||||
import { authProvidersState } from '@/client-config/states/authProvidersState';
|
||||
import { billingState } from '@/client-config/states/billingState';
|
||||
import { calendarBookingPageIdState } from '@/client-config/states/calendarBookingPageIdState';
|
||||
import { canManageFeatureFlagsState } from '@/client-config/states/canManageFeatureFlagsState';
|
||||
import { captchaState } from '@/client-config/states/captchaState';
|
||||
import { chromeExtensionIdState } from '@/client-config/states/chromeExtensionIdState';
|
||||
@ -85,6 +86,10 @@ export const ClientConfigProviderEffect = () => {
|
||||
isConfigVariablesInDbEnabledState,
|
||||
);
|
||||
|
||||
const setCalendarBookingPageId = useSetRecoilState(
|
||||
calendarBookingPageIdState,
|
||||
);
|
||||
|
||||
const { data, loading, error, fetchClientConfig } = useClientConfig();
|
||||
|
||||
useEffect(() => {
|
||||
@ -173,6 +178,8 @@ export const ClientConfigProviderEffect = () => {
|
||||
...currentStatus,
|
||||
isSaved: true,
|
||||
}));
|
||||
|
||||
setCalendarBookingPageId(data?.clientConfig?.calendarBookingPageId ?? null);
|
||||
}, [
|
||||
data,
|
||||
loading,
|
||||
@ -198,6 +205,7 @@ export const ClientConfigProviderEffect = () => {
|
||||
setGoogleCalendarEnabled,
|
||||
setIsAttachmentPreviewEnabled,
|
||||
setIsConfigVariablesInDbEnabled,
|
||||
setCalendarBookingPageId,
|
||||
]);
|
||||
|
||||
return <></>;
|
||||
|
||||
@ -62,6 +62,7 @@ export const GET_CLIENT_CONFIG = gql`
|
||||
isGoogleMessagingEnabled
|
||||
isGoogleCalendarEnabled
|
||||
isConfigVariablesInDbEnabled
|
||||
calendarBookingPageId
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@ -0,0 +1,6 @@
|
||||
import { createState } from 'twenty-ui/utilities';
|
||||
|
||||
export const calendarBookingPageIdState = createState<string | null>({
|
||||
key: 'calendarBookingPageIdState',
|
||||
defaultValue: null,
|
||||
});
|
||||
Reference in New Issue
Block a user