Skip to content

Commit

Permalink
fix: show chat count
Browse files Browse the repository at this point in the history
  • Loading branch information
amar-1995 committed Mar 18, 2024
1 parent 75e9bce commit 1aa5b42
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/roomkit-react/src/Prebuilt/layouts/HLSView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import { APP_DATA, EMOJI_REACTION_TYPE, POLL_STATE, POLL_VIEWS, SIDE_PANE_OPTION
let hlsPlayer;
const toastMap = {};

const ToggleChat = () => {
const ToggleChat = ({ isFullScreen = false }) => {
const { elements } = useRoomLayoutConferencingScreen();
const sidepane = useHMSStore(selectAppData(APP_DATA.sidePane));
const toggleChat = useSidepaneToggle(SIDE_PANE_OPTIONS.CHAT);
Expand All @@ -51,7 +51,10 @@ const ToggleChat = () => {
const hmsActions = useHMSActions();

useEffect(() => {
match({ sidepane, isMobile, showChat })
match({ sidepane, isMobile, showChat, isFullScreen })
.with({ isFullScreen: true }, () => {
hmsActions.setAppData(APP_DATA.sidePane, '');
})
.with({ isMobile: true, showChat: true, sidepane: P.when(value => !value) }, () => {
toggleChat();
})
Expand All @@ -61,7 +64,7 @@ const ToggleChat = () => {
.otherwise(() => {
//do nothing
});
}, [sidepane, isMobile, toggleChat, showChat, hmsActions]);
}, [sidepane, isMobile, toggleChat, showChat, hmsActions, isFullScreen]);
return null;
};
const HLSView = () => {
Expand Down Expand Up @@ -723,7 +726,7 @@ const HLSView = () => {
</HMSVideoPlayer.Root>
</Flex>
</HMSPlayerContext.Provider>
<ToggleChat />
<ToggleChat isFullScreen={isFullScreen} />
{isMobile && !isFullScreen && <HLSViewTitle />}
</Flex>
);
Expand Down

0 comments on commit 1aa5b42

Please sign in to comment.