Skip to content

Commit

Permalink
fix: chat toggle after closing poll
Browse files Browse the repository at this point in the history
  • Loading branch information
KaustubhKumar05 committed Mar 4, 2024
1 parent 2a6787b commit 9015099
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { useCallback } from 'react';
import { match, P } from 'ts-pattern';
import { selectAppData, useHMSActions, useHMSStore, useHMSVanillaStore } from '@100mslive/react-sdk';
import { useRoomLayoutConferencingScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
import { usePollViewState } from './useUISettings';
import { useMobileHLSStream } from '../../common/hooks';
import { APP_DATA, POLL_STATE, POLL_VIEWS, SIDE_PANE_OPTIONS } from '../../common/constants';

/**
Expand Down Expand Up @@ -45,8 +43,6 @@ export const usePollViewToggle = () => {
const hmsActions = useHMSActions();
const { view, setPollState } = usePollViewState();
const isOpen = useSidepaneState() === SIDE_PANE_OPTIONS.POLLS;
const isMobileHLSStream = useMobileHLSStream();
const { elements } = useRoomLayoutConferencingScreen();

const togglePollView = useCallback(
id => {
Expand All @@ -73,10 +69,7 @@ export const usePollViewToggle = () => {
[POLL_STATE.pollInView]: undefined,
[POLL_STATE.view]: null,
});
hmsActions.setAppData(
APP_DATA.sidePane,
isMobileHLSStream && !!elements?.chat ? SIDE_PANE_OPTIONS.CHAT : '',
);
hmsActions.setAppData(APP_DATA.sidePane, '');
},
)
.otherwise(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/roomkit-react/src/Prebuilt/layouts/HLSView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const ToggleChat = () => {
const showChat = !!elements?.chat;
const isMobile = useMedia(config.media.md);
useEffect(() => {
if (sidepane === '' && isMobile && showChat) {
if (!sidepane && isMobile && showChat) {
toggleChat();
}
}, [sidepane, isMobile, toggleChat, showChat]);
Expand Down

0 comments on commit 9015099

Please sign in to comment.