Skip to content

Commit

Permalink
fix: poll close, mweb options crash
Browse files Browse the repository at this point in the history
  • Loading branch information
raviteja83 authored Feb 28, 2024
1 parent 6479b59 commit d621d05
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,39 @@ export const usePollViewToggle = () => {

const togglePollView = useCallback(
id => {
const newView = match({ id, isOpen, view })
match({ id, isOpen, view })
.with(
{
id: P.string,
},
() => POLL_VIEWS.VOTE,
() => {
setPollState({
[POLL_STATE.pollInView]: id,
[POLL_STATE.view]: POLL_VIEWS.VOTE,
});
hmsActions.setAppData(APP_DATA.sidePane, SIDE_PANE_OPTIONS.POLLS);
},
)
.with(
{
isOpen: true,
view: P.when(view => !!view),
},
() => null,
() => {
setPollState({
[POLL_STATE.pollInView]: undefined,
[POLL_STATE.view]: null,
});
hmsActions.setAppData(APP_DATA.sidePane, '');
},
)
.otherwise(() => POLL_VIEWS.CREATE_POLL_QUIZ);

setPollState({
[POLL_STATE.pollInView]: id,
[POLL_STATE.view]: newView,
});
hmsActions.setAppData(APP_DATA.sidePane, newView ? SIDE_PANE_OPTIONS.POLLS : '');
.otherwise(() => {
setPollState({
[POLL_STATE.pollInView]: undefined,
[POLL_STATE.view]: POLL_VIEWS.CREATE_POLL_QUIZ,
});
hmsActions.setAppData(APP_DATA.sidePane, SIDE_PANE_OPTIONS.POLLS);
});
},
[hmsActions, view, setPollState, isOpen],
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ export const MwebOptions = ({
{match({ isBrowserRecordingOn, isRecordingLoading })
.with({ isBrowserRecordingOn: true, isRecordingLoading: false }, () => 'Recording On')
.with({ isRecordingLoading: true }, () => 'Starting Recording')
.with({ isRecordingLoading: false }, () => 'Start Recording')}
.with({ isRecordingLoading: false }, () => 'Start Recording')
.otherwise(() => null)}
</ActionTile.Title>
</ActionTile.Root>
) : null}
Expand Down

0 comments on commit d621d05

Please sign in to comment.