From 3e26bbf43079dd6e3e2532022a3e2aeb0c3a6e53 Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Fri, 19 Jan 2024 11:06:14 +0100 Subject: [PATCH] fix(breakout): request / dismiss assistance if user is the first / last in the room Signed-off-by: Maksim Sukharev --- src/components/TopBar/TopBarMenu.vue | 11 ++++++++++- src/store/callViewStore.js | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/components/TopBar/TopBarMenu.vue b/src/components/TopBar/TopBarMenu.vue index 888d9aef5ca..09a23c851c3 100644 --- a/src/components/TopBar/TopBarMenu.vue +++ b/src/components/TopBar/TopBarMenu.vue @@ -467,8 +467,17 @@ export default { // If the current conversation is a break-out room and the user is not a moderator, // also send request for assistance to the moderators. if (this.userIsInBreakoutRoomAndInCall && !this.canModerate) { - if (newState) { + const hasRaisedHands = Object.keys(this.$store.getters.participantRaisedHandList) + .filter(sessionId => sessionId !== this.$store.getters.getSessionId()) + .length !== 0 + if (hasRaisedHands) { + return // Assistance is already requested by someone in the room + } + const hasAssistanceRequested = this.conversation.breakoutRoomStatus === CONVERSATION.BREAKOUT_ROOM_STATUS.STATUS_ASSISTANCE_REQUESTED + if (newState && !hasAssistanceRequested) { this.$store.dispatch('requestAssistanceAction', { token: this.token }) + } else if (!newState && hasAssistanceRequested) { + this.$store.dispatch('resetRequestAssistanceAction', { token: this.token }) } } }, diff --git a/src/store/callViewStore.js b/src/store/callViewStore.js index 54ead1acf3e..783023bd94e 100644 --- a/src/store/callViewStore.js +++ b/src/store/callViewStore.js @@ -54,6 +54,9 @@ const getters = { return state.selectedVideoPeerId }, isQualityWarningTooltipDismissed: (state) => state.qualityWarningTooltipDismissed, + participantRaisedHandList: (state) => { + return state.participantRaisedHands + }, getParticipantRaisedHand: (state) => (sessionIds) => { for (let i = 0; i < sessionIds.length; i++) { if (state.participantRaisedHands[sessionIds[i]]) {