Skip to content

Commit

Permalink
fix(breakout): request / dismiss assistance if user is the first / la…
Browse files Browse the repository at this point in the history
…st in the room

Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
  • Loading branch information
Antreesy committed Jan 22, 2024
1 parent 335a3b2 commit 3e26bbf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/TopBar/TopBarMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions src/store/callViewStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]]) {
Expand Down

0 comments on commit 3e26bbf

Please sign in to comment.