participants: skip local participant join notification
Also, use the helper function to get the display name for a participant.
This commit is contained in:
parent
12c18657d5
commit
186ba70cb7
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue