participants: skip local participant join notification

Also, use the helper function to get the display name for a participant.
This commit is contained in:
Saúl Ibarra Corretgé 2019-06-19 12:16:27 +02:00 committed by Saúl Ibarra Corretgé
parent 12c18657d5
commit 186ba70cb7
2 changed files with 4 additions and 7 deletions

View File

@ -1,5 +1,3 @@
/* global interfaceConfig */
import throttle from 'lodash/throttle'; import throttle from 'lodash/throttle';
import { set } from '../redux'; import { set } from '../redux';
@ -517,8 +515,7 @@ const _throttledNotifyParticipantConnected = throttle(dispatch => {
* @returns {Function} * @returns {Function}
*/ */
export function showParticipantJoinedNotification(displayName) { export function showParticipantJoinedNotification(displayName) {
joinedParticipantsNames.push( joinedParticipantsNames.push(displayName);
displayName || interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME);
return dispatch => _throttledNotifyParticipantConnected(dispatch); return dispatch => _throttledNotifyParticipantConnected(dispatch);
} }

View File

@ -118,10 +118,10 @@ MiddlewareRegistry.register(store => next => action => {
case PARTICIPANT_JOINED: { case PARTICIPANT_JOINED: {
_maybePlaySounds(store, action); _maybePlaySounds(store, action);
const { participant: { name } } = action; const { participant: p } = action;
if (name) { if (!p.local) {
store.dispatch(showParticipantJoinedNotification(name)); store.dispatch(showParticipantJoinedNotification(getParticipantDisplayName(store.getState, p.id)));
} }
return _participantJoinedOrUpdated(store, next, action); return _participantJoinedOrUpdated(store, next, action);