fix(external-api): dismiss lobby notification after handling the knocking participant (#11049)

This commit is contained in:
Mihaela Dumitru 2022-03-01 14:17:06 +02:00 committed by GitHub
parent c69fdd766c
commit c35473d5e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

View File

@ -72,7 +72,7 @@ import {
captureLargeVideoScreenshot,
resizeLargeVideo
} from '../../react/features/large-video/actions.web';
import { toggleLobbyMode, setKnockingParticipantApproval } from '../../react/features/lobby/actions';
import { toggleLobbyMode, answerKnockingParticipant } from '../../react/features/lobby/actions';
import {
close as closeParticipantsPane,
open as openParticipantsPane
@ -140,7 +140,7 @@ function initCommands() {
APP.store.dispatch(createBreakoutRoom(name));
},
'answer-knocking-participant': (id, approved) => {
APP.store.dispatch(setKnockingParticipantApproval(id, approved));
APP.store.dispatch(answerKnockingParticipant(id, approved));
},
'approve-video': participantId => {
if (!isLocalParticipantModerator(APP.store.getState())) {

View File

@ -9,6 +9,7 @@ import {
setPassword
} from '../base/conference';
import { getLocalParticipant } from '../base/participants';
import { hideNotification, LOBBY_NOTIFICATION_ID } from '../notifications';
import {
KNOCKING_PARTICIPANT_ARRIVED_OR_UPDATED,
@ -65,6 +66,20 @@ export function participantIsKnockingOrUpdated(participant: Object) {
};
}
/**
* Handles a knocking participant and dismisses the notification.
*
* @param {string} id - The id of the knocking participant.
* @param {boolean} approved - True if the participant is approved, false otherwise.
* @returns {Function}
*/
export function answerKnockingParticipant(id: string, approved: boolean) {
return async (dispatch: Dispatch<any>) => {
dispatch(setKnockingParticipantApproval(id, approved));
dispatch(hideNotification(LOBBY_NOTIFICATION_ID));
};
}
/**
* Approves (lets in) or rejects a knocking participant.
*