Skip to content

Commit

Permalink
fix(conference) clear raised hands when conference changes
Browse files Browse the repository at this point in the history
  • Loading branch information
saghul committed Oct 12, 2023
1 parent 07bade2 commit 86e295e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
8 changes: 8 additions & 0 deletions react/features/base/participants/actionTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,14 @@ export const SET_LOADABLE_AVATAR_URL = 'SET_LOADABLE_AVATAR_URL';
*/
export const LOCAL_PARTICIPANT_RAISE_HAND = 'LOCAL_PARTICIPANT_RAISE_HAND';

/**
* Clear the raise hand queue.
* {
* type: RAISE_HAND_CLEAR
* }
*/
export const RAISE_HAND_CLEAR = 'RAISE_HAND_CLEAR';

/**
* Updates participant in raise hand queue.
* {
Expand Down
14 changes: 14 additions & 0 deletions react/features/base/participants/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
PARTICIPANT_SOURCES_UPDATED,
PARTICIPANT_UPDATED,
PIN_PARTICIPANT,
RAISE_HAND_CLEAR,
RAISE_HAND_UPDATED,
SCREENSHARE_PARTICIPANT_NAME_CHANGED,
SET_LOADABLE_AVATAR_URL,
Expand Down Expand Up @@ -629,6 +630,19 @@ export function raiseHand(enabled: boolean) {
};
}

/**
* Clear the raise hand queue.
*
* @returns {{
* type: RAISE_HAND_CLEAR
* }}
*/
export function raiseHandClear() {
return {
type: RAISE_HAND_CLEAR
};
}

/**
* Update raise hand queue of participants.
*
Expand Down
7 changes: 7 additions & 0 deletions react/features/base/participants/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
PARTICIPANT_SOURCES_UPDATED,
PARTICIPANT_UPDATED,
PIN_PARTICIPANT,
RAISE_HAND_CLEAR,
RAISE_HAND_UPDATED,
SCREENSHARE_PARTICIPANT_NAME_CHANGED,
SET_LOADABLE_AVATAR_URL
Expand Down Expand Up @@ -465,6 +466,12 @@ ReducerRegistry.register<IParticipantsState>('features/base/participants',

return { ...state };
}
case RAISE_HAND_CLEAR: {
return {
...state,
raisedHandsQueue: []
};
}
case RAISE_HAND_UPDATED: {
return {
...state,
Expand Down
5 changes: 4 additions & 1 deletion react/features/conference/middleware.any.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { getLocalizedDateFormatter } from '../base/i18n/dateUtil';
import { translateToHTML } from '../base/i18n/functions';
import i18next from '../base/i18n/i18next';
import { browser } from '../base/lib-jitsi-meet';
import { pinParticipant } from '../base/participants/actions';
import { pinParticipant, raiseHandClear } from '../base/participants/actions';
import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
import StateListenerRegistry from '../base/redux/StateListenerRegistry';
import { SET_REDUCED_UI } from '../base/responsive-ui/actionTypes';
Expand Down Expand Up @@ -90,6 +90,9 @@ StateListenerRegistry.register(
// remaining pinned, since it's not destroyed across runs.
dispatch(pinParticipant(null));

// Clear raised hands.
dispatch(raiseHandClear());

// XXX I wonder if there is a better way to do this. At this stage
// we do know what dialogs we want to keep but the list of those
// we want to hide is a lot longer. Thus we take a bit of a shortcut
Expand Down

0 comments on commit 86e295e

Please sign in to comment.