You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Add /router to isBookingPages to prevent 500 error on customPageMessage redirect (calcom#25522)
* Add /router to isBookingPages
* Remove Dynamic Posthog Provider from AppProvider.tsx because that is only used by the pages router, and the pages router is only in use by the /router endpoint, which is a booking page and we havent implemented corresponding GeoProvider support for it
// Use namespace of embed to ensure same namespaced embed are displayed with same theme. This allows different embeds on the same website to be themed differently
@@ -209,8 +211,8 @@ function getThemeProviderProps({
209
211
? ThemeSupport.Booking
210
212
: // if isThemeSupported is explicitly false, we don't use theme there
@@ -234,13 +236,13 @@ function getThemeProviderProps({
234
236
235
237
conststorageKey=isEmbedMode
236
238
? // Same Namespace, Same Organizer but different themes would still work seamless and not cause theme flicker
237
-
// Even though it's recommended to use different namespaces when you want to theme differently on the same page but if the embeds are on different pages, the problem can still arise
// Even though it's recommended to use different namespaces when you want to theme differently on the same page but if the embeds are on different pages, the problem can still arise
// TODO: This approach of checking booking page isn't correct.
5
+
// app.cal.com/rick is a booking page but useIsBookingPage won't return true. This is because all unregistered router in Next.js could technically be a booking page throw catch all routes.
6
+
// The only way to confirm it is by actually checking if we actually rendered a booking route.
5
7
exportdefaultfunctionuseIsBookingPage(): boolean{
6
8
constpathname=usePathname();
7
9
constisBookingPage=[
@@ -13,6 +15,7 @@ export default function useIsBookingPage(): boolean {
13
15
"/d",// Private Link of booking page
14
16
"/apps/routing-forms/routing-link",// Routing Form page
15
17
"/forms/",// Rewrites to /apps/routing-forms/routing-link
18
+
"/router",// Headless router page - Loads as a page when redirect type is customPageMessage
0 commit comments