diff --git a/react/features/base/participants/actionTypes.ts b/react/features/base/participants/actionTypes.ts index 50040cf910c7..85d7eb396f11 100644 --- a/react/features/base/participants/actionTypes.ts +++ b/react/features/base/participants/actionTypes.ts @@ -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. * { diff --git a/react/features/base/participants/actions.ts b/react/features/base/participants/actions.ts index 650db59cda68..42fe6afe13d2 100644 --- a/react/features/base/participants/actions.ts +++ b/react/features/base/participants/actions.ts @@ -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, @@ -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. * diff --git a/react/features/base/participants/reducer.ts b/react/features/base/participants/reducer.ts index d08cba0b6b5a..92d8fce39909 100644 --- a/react/features/base/participants/reducer.ts +++ b/react/features/base/participants/reducer.ts @@ -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 @@ -465,6 +466,12 @@ ReducerRegistry.register('features/base/participants', return { ...state }; } + case RAISE_HAND_CLEAR: { + return { + ...state, + raisedHandsQueue: [] + }; + } case RAISE_HAND_UPDATED: { return { ...state, diff --git a/react/features/conference/middleware.any.ts b/react/features/conference/middleware.any.ts index 9131c39a4324..07a619d286c2 100644 --- a/react/features/conference/middleware.any.ts +++ b/react/features/conference/middleware.any.ts @@ -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'; @@ -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