ref: move participant joined notification to the middleware

This commit is contained in:
paweldomas 2019-02-07 09:30:20 -06:00 committed by Zoltan Bettenbuk
parent 08efc46f21
commit f3f8dc2072
2 changed files with 11 additions and 8 deletions

View File

@ -14,10 +14,7 @@ import VideoLayout from './videolayout/VideoLayout';
import Filmstrip from './videolayout/Filmstrip';
import { JitsiTrackErrors } from '../../react/features/base/lib-jitsi-meet';
import {
getLocalParticipant,
showParticipantJoinedNotification
} from '../../react/features/base/participants';
import { getLocalParticipant } from '../../react/features/base/participants';
import { toggleChat } from '../../react/features/chat';
import { openDisplayNamePrompt } from '../../react/features/display-name';
import { setEtherpadHasInitialzied } from '../../react/features/etherpad';
@ -380,8 +377,6 @@ UI.addUser = function(user) {
if (status) {
// FIXME: move updateUserStatus in participantPresenceChanged action
UI.updateUserStatus(user, status);
} else {
APP.store.dispatch(showParticipantJoinedNotification(displayName));
}
// set initial display name

View File

@ -16,7 +16,8 @@ import {
localParticipantJoined,
localParticipantLeft,
participantLeft,
participantUpdated
participantUpdated,
showParticipantJoinedNotification
} from './actions';
import {
DOMINANT_SPEAKER_CHANGED,
@ -110,10 +111,17 @@ MiddlewareRegistry.register(store => next => action => {
break;
}
case PARTICIPANT_JOINED:
case PARTICIPANT_JOINED: {
_maybePlaySounds(store, action);
const { participant: { name } } = action;
if (name) {
store.dispatch(showParticipantJoinedNotification(name));
}
return _participantJoinedOrUpdated(store, next, action);
}
case PARTICIPANT_LEFT:
_maybePlaySounds(store, action);