From e118426decb05214169c356884093642a648bdde Mon Sep 17 00:00:00 2001 From: Kaustubh Kumar Date: Wed, 11 Oct 2023 11:19:21 +0530 Subject: [PATCH] fix: remove leave prompt --- apps/100ms-custom-app/src/App.jsx | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/apps/100ms-custom-app/src/App.jsx b/apps/100ms-custom-app/src/App.jsx index 3204964624..03fb6e7ece 100644 --- a/apps/100ms-custom-app/src/App.jsx +++ b/apps/100ms-custom-app/src/App.jsx @@ -1,10 +1,4 @@ -import React, { - Suspense, - useCallback, - useEffect, - useRef, - useState, -} from 'react'; +import React, { Suspense, useEffect, useRef, useState } from 'react'; import { Flex, HMSPrebuilt } from '@100mslive/roomkit-react'; import { useOverridePrebuiltLayout } from './hooks/useOverridePrebuiltLayout'; import { useSearchParam } from './hooks/useSearchParam'; @@ -28,13 +22,6 @@ const App = () => { const { roomId, role } = getRoomIdRoleFromUrl(); const { overrideLayout, isHeadless } = useOverridePrebuiltLayout(); const hmsPrebuiltRef = useRef(); - const confirmLeave = useCallback(e => { - e.returnValue = 'Are you sure you want to leave?'; - }, []); - const removeExitListener = useCallback( - () => window.removeEventListener('beforeunload', confirmLeave), - [] - ); useEffect(() => { if (roomCode) { @@ -88,11 +75,6 @@ const App = () => { authToken={authToken} roomId={roomId} role={role} - onLeave={removeExitListener} - onJoin={() => { - if (!isHeadless) - window.addEventListener('beforeunload', confirmLeave); - }} screens={overrideLayout ? overrideLayout : undefined} options={{ userName: isHeadless ? 'Beam' : undefined,