Browse Source

ref: move participant joined notification to the middleware

j8
paweldomas 6 years ago
parent
commit
f3f8dc2072
2 changed files with 11 additions and 8 deletions
  1. 1
    6
      modules/UI/UI.js
  2. 10
    2
      react/features/base/participants/middleware.js

+ 1
- 6
modules/UI/UI.js View File

@@ -14,10 +14,7 @@ import VideoLayout from './videolayout/VideoLayout';
14 14
 import Filmstrip from './videolayout/Filmstrip';
15 15
 
16 16
 import { JitsiTrackErrors } from '../../react/features/base/lib-jitsi-meet';
17
-import {
18
-    getLocalParticipant,
19
-    showParticipantJoinedNotification
20
-} from '../../react/features/base/participants';
17
+import { getLocalParticipant } from '../../react/features/base/participants';
21 18
 import { toggleChat } from '../../react/features/chat';
22 19
 import { openDisplayNamePrompt } from '../../react/features/display-name';
23 20
 import { setEtherpadHasInitialzied } from '../../react/features/etherpad';
@@ -380,8 +377,6 @@ UI.addUser = function(user) {
380 377
     if (status) {
381 378
         // FIXME: move updateUserStatus in participantPresenceChanged action
382 379
         UI.updateUserStatus(user, status);
383
-    } else {
384
-        APP.store.dispatch(showParticipantJoinedNotification(displayName));
385 380
     }
386 381
 
387 382
     // set initial display name

+ 10
- 2
react/features/base/participants/middleware.js View File

@@ -16,7 +16,8 @@ import {
16 16
     localParticipantJoined,
17 17
     localParticipantLeft,
18 18
     participantLeft,
19
-    participantUpdated
19
+    participantUpdated,
20
+    showParticipantJoinedNotification
20 21
 } from './actions';
21 22
 import {
22 23
     DOMINANT_SPEAKER_CHANGED,
@@ -110,10 +111,17 @@ MiddlewareRegistry.register(store => next => action => {
110 111
         break;
111 112
     }
112 113
 
113
-    case PARTICIPANT_JOINED:
114
+    case PARTICIPANT_JOINED: {
114 115
         _maybePlaySounds(store, action);
115 116
 
117
+        const { participant: { name } } = action;
118
+
119
+        if (name) {
120
+            store.dispatch(showParticipantJoinedNotification(name));
121
+        }
122
+
116 123
         return _participantJoinedOrUpdated(store, next, action);
124
+    }
117 125
 
118 126
     case PARTICIPANT_LEFT:
119 127
         _maybePlaySounds(store, action);

Loading…
Cancel
Save