diff --git a/apps/web/next.config.js b/apps/web/next.config.js index 0e5ef48391..e3108db4c3 100644 --- a/apps/web/next.config.js +++ b/apps/web/next.config.js @@ -297,6 +297,11 @@ const nextConfig = { destination: "/api/link?action=:action&email=:email&bookingUid=:bookingUid&oldToken=:oldToken", permanent: true, }, + { + source: "/support", + destination: "/event-types?openIntercom=true", + permanent: true, + }, ]; if (process.env.NEXT_PUBLIC_WEBAPP_URL === "https://app.cal.com") { diff --git a/apps/web/pages/event-types/index.tsx b/apps/web/pages/event-types/index.tsx index 1f2f0a9991..e2ec5c7043 100644 --- a/apps/web/pages/event-types/index.tsx +++ b/apps/web/pages/event-types/index.tsx @@ -8,6 +8,7 @@ import type { FC } from "react"; import { useEffect, useState, memo } from "react"; import { z } from "zod"; +import useIntercom from "@calcom/features/ee/support/lib/intercom/useIntercom"; import { EventTypeDescriptionLazy as EventTypeDescription } from "@calcom/features/eventtypes/components"; import CreateEventTypeDialog from "@calcom/features/eventtypes/components/CreateEventTypeDialog"; import { DuplicateDialog } from "@calcom/features/eventtypes/components/DuplicateDialog"; @@ -756,9 +757,16 @@ const WithQuery = withQuery(trpc.viewer.eventTypes.getByViewer); const EventTypesPage = () => { const { t } = useLocale(); const router = useRouter(); - + const { open } = useIntercom(); + const { query } = router; const isMobile = useMediaQuery("(max-width: 768px)"); + useEffect(() => { + if (query?.openIntercom && query?.openIntercom === "true") { + open(); + } + }, []); + return (