Skip to content

Commit

Permalink
fix: remove leave prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
KaustubhKumar05 authored Oct 11, 2023
1 parent c337844 commit e118426
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions apps/100ms-custom-app/src/App.jsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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) {
Expand Down Expand Up @@ -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,
Expand Down

2 comments on commit e118426

@vercel
Copy link

@vercel vercel bot commented on e118426 Oct 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on e118426 Oct 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

storybook-app – ./packages/roomkit-react

storybook-app-100mslive.vercel.app
storybook-app-five.vercel.app
storybook-app-git-production-100mslive.vercel.app
ui.100ms.live

Please sign in to comment.