fix: Fixes emitting conference left event in iframeAPI.

Moving to breakout room and back in main room do not fire videoConferenceLeft events.
And the videoConferenceJoined was reporting wrong conference name on join.
This commit is contained in:
Дамян Минков 2021-12-15 15:50:03 -06:00
parent ffe74ca68b
commit e7bac3ad44
2 changed files with 6 additions and 3 deletions

View File

@ -233,7 +233,9 @@ export function moveToRoom(roomId?: string) {
const isVideoMuted = isLocalCameraTrackMuted(localTracks);
try {
await APP.conference.leaveRoom(false /* doDisconnect */);
// all places we fire notifyConferenceLeft we pass the room name from APP.conference
await APP.conference.leaveRoom(false /* doDisconnect */).then(
() => APP.API.notifyConferenceLeft(APP.conference.roomName));
} catch (error) {
logger.warn('APP.conference.leaveRoom() rejected with:', error);

View File

@ -88,11 +88,12 @@ MiddlewareRegistry.register(store => next => action => {
case CONFERENCE_JOINED: {
const state = store.getState();
const { defaultLocalDisplayName } = state['features/base/config'];
const { room } = state['features/base/conference'];
const { loadableAvatarUrl, name, id } = getLocalParticipant(state);
// we use APP.conference.roomName as we do not update state['features/base/conference'].room when
// moving between rooms in case of breakout rooms and it stays always with the name of the main room
APP.API.notifyConferenceJoined(
room,
APP.conference.roomName,
id,
{
displayName: name,