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

View File

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