From 9dba1d30b098927b8639088ec435baeba18fcb56 Mon Sep 17 00:00:00 2001 From: Robert Pintilii Date: Thu, 26 May 2022 12:36:12 +0100 Subject: [PATCH] fix(raise-hand) Fix multiple raise hand from notification (#11586) Only dispatch raise hand if hand was not already raised --- react/features/av-moderation/middleware.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/react/features/av-moderation/middleware.js b/react/features/av-moderation/middleware.js index d11e742b98..1bac5fde1b 100644 --- a/react/features/av-moderation/middleware.js +++ b/react/features/av-moderation/middleware.js @@ -80,6 +80,8 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => { let descriptionKey; let titleKey; let uid; + const localParticipant = getLocalParticipant(getState); + const raisedHand = hasRaisedHand(localParticipant); switch (action.mediaType) { case MEDIA_TYPE.AUDIO: { @@ -102,7 +104,7 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => { dispatch(showNotification({ customActionNameKey: [ 'notify.raiseHandAction' ], customActionHandler: [ () => batch(() => { - dispatch(raiseHand(true)); + !raisedHand && dispatch(raiseHand(true)); dispatch(hideNotification(uid)); }) ], descriptionKey,