From c2b091aa67cdfce3f8d965539c71955f74cd0867 Mon Sep 17 00:00:00 2001 From: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Date: Tue, 13 May 2025 22:18:14 +0530 Subject: [PATCH] perf: don't load ring.mp3 on booking page (#21272) --- apps/web/app/layout.tsx | 5 +---- apps/web/app/providers.tsx | 5 ++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsx index bba2e1bade..a54303ed3c 100644 --- a/apps/web/app/layout.tsx +++ b/apps/web/app/layout.tsx @@ -7,7 +7,6 @@ import React from "react"; import { getLocale } from "@calcom/features/auth/lib/getLocale"; import { loadTranslations } from "@calcom/lib/server/i18n"; import { IconSprites } from "@calcom/ui/components/icon"; -import { NotificationSoundHandler } from "@calcom/web/components/notification-sound-handler"; import { buildLegacyRequest } from "@lib/buildLegacyCtx"; @@ -152,13 +151,11 @@ export default async function RootLayout({ children }: { children: React.ReactNo ]} /> - + {children} - {!isEmbed && } - ); diff --git a/apps/web/app/providers.tsx b/apps/web/app/providers.tsx index aaca3b3dc6..84e1b21e7d 100644 --- a/apps/web/app/providers.tsx +++ b/apps/web/app/providers.tsx @@ -5,20 +5,23 @@ import { SessionProvider } from "next-auth/react"; import CacheProvider from "react-inlinesvg/provider"; import { WebPushProvider } from "@calcom/features/notifications/WebPushContext"; +import { NotificationSoundHandler } from "@calcom/web/components/notification-sound-handler"; import useIsBookingPage from "@lib/hooks/useIsBookingPage"; import PlainChat from "@lib/plain/dynamicProvider"; type ProvidersProps = { + isEmbed: boolean; children: React.ReactNode; }; -export function Providers({ children }: ProvidersProps) { +export function Providers({ isEmbed, children }: ProvidersProps) { const isBookingPage = useIsBookingPage(); return ( {!isBookingPage ? : null} + {!isEmbed && !isBookingPage && } {/* @ts-expect-error FIXME remove this comment when upgrading typescript to v5 */} {children}