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 { set } from '../redux';
@ -517,8 +515,7 @@ const _throttledNotifyParticipantConnected = throttle(dispatch => {
* @returns {Function}
*/
export function showParticipantJoinedNotification(displayName) {
joinedParticipantsNames.push(
displayName || interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME);
joinedParticipantsNames.push(displayName);
return dispatch => _throttledNotifyParticipantConnected(dispatch);
}

View File

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