Skip to content

Commit

Permalink
fix: show chat when polls closed
Browse files Browse the repository at this point in the history
  • Loading branch information
raviteja83 committed Mar 4, 2024
1 parent 9438baa commit 2a6787b
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
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 @@ -43,6 +45,8 @@ 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 @@ -69,7 +73,10 @@ export const usePollViewToggle = () => {
[POLL_STATE.pollInView]: undefined,
[POLL_STATE.view]: null,
});
hmsActions.setAppData(APP_DATA.sidePane, '');
hmsActions.setAppData(
APP_DATA.sidePane,
isMobileHLSStream && !!elements?.chat ? SIDE_PANE_OPTIONS.CHAT : '',
);
},
)
.otherwise(() => {
Expand Down

0 comments on commit 2a6787b

Please sign in to comment.