Skip to content

Commit

Permalink
fix: remove redundant vb reset call
Browse files Browse the repository at this point in the history
  • Loading branch information
KaustubhKumar05 committed Nov 7, 2024
1 parent 693901c commit 0045a2a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions packages/roomkit-react/src/Prebuilt/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { MutableRefObject, useEffect, useRef } from 'react';
import { HMSStatsStoreWrapper, HMSStoreWrapper, IHMSNotifications } from '@100mslive/hms-video-store';
import { HMSVirtualBackgroundTypes } from '@100mslive/hms-virtual-background';
import { Layout, Logo, Screens, Theme, Typography } from '@100mslive/types-prebuilt';
import { match } from 'ts-pattern';
import {
Expand Down Expand Up @@ -28,7 +27,6 @@ import { PIPProvider } from './components/PIP/PIPProvider';
import { PreviewScreen } from './components/Preview/PreviewScreen';
// @ts-ignore: No implicit Any
import { ToastContainer } from './components/Toast/ToastContainer';
import { VBHandler } from './components/VirtualBackground/VBHandler';
import { Sheet } from './layouts/Sheet';
import { RoomLayoutContext, RoomLayoutProvider, useRoomLayout } from './provider/roomLayoutProvider';
import { DialogContainerProvider } from '../context/DialogContext';
Expand All @@ -50,7 +48,7 @@ import {
// @ts-ignore: No implicit Any
import { FeatureFlags } from './services/FeatureFlags';
// @ts-ignore: No implicit Any
import { APP_DATA, DEFAULT_PORTAL_CONTAINER } from './common/constants';
import { DEFAULT_PORTAL_CONTAINER } from './common/constants';

export type HMSPrebuiltOptions = {
userName?: string;
Expand Down Expand Up @@ -131,8 +129,6 @@ export const HMSPrebuilt = React.forwardRef<HMSPrebuiltRefType, HMSPrebuiltProps
useEffect(() => {
// leave room when component unmounts
return () => {
VBHandler.reset();
reactiveStore?.current?.hmsActions.setAppData(APP_DATA.background, HMSVirtualBackgroundTypes.NONE);
reactiveStore?.current?.hmsActions.leave();
};
}, []);
Expand Down
2 changes: 1 addition & 1 deletion packages/roomkit-react/src/Prebuilt/AppStateContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ export const useAppStateManager = () => {
.otherwise(() => {
// do nothing
});
}, [roomLayout, roomState, isLeaveScreenEnabled, isPreviewScreenEnabled, prevRoomState, redirectToLeave]);
}, [roomLayout, roomState, isLeaveScreenEnabled, isPreviewScreenEnabled, prevRoomState, redirectToLeave, hmsActions]);
return { activeState, rejoin };
};

0 comments on commit 0045a2a

Please sign in to comment.