Pārlūkot izejas kodu

ref: move participant joined notification to the middleware

master
paweldomas 6 gadus atpakaļ
vecāks
revīzija
f3f8dc2072
2 mainītis faili ar 11 papildinājumiem un 8 dzēšanām
  1. 1
    6
      modules/UI/UI.js
  2. 10
    2
      react/features/base/participants/middleware.js

+ 1
- 6
modules/UI/UI.js Parādīt failu

14
 import Filmstrip from './videolayout/Filmstrip';
14
 import Filmstrip from './videolayout/Filmstrip';
15
 
15
 
16
 import { JitsiTrackErrors } from '../../react/features/base/lib-jitsi-meet';
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
 import { toggleChat } from '../../react/features/chat';
18
 import { toggleChat } from '../../react/features/chat';
22
 import { openDisplayNamePrompt } from '../../react/features/display-name';
19
 import { openDisplayNamePrompt } from '../../react/features/display-name';
23
 import { setEtherpadHasInitialzied } from '../../react/features/etherpad';
20
 import { setEtherpadHasInitialzied } from '../../react/features/etherpad';
380
     if (status) {
377
     if (status) {
381
         // FIXME: move updateUserStatus in participantPresenceChanged action
378
         // FIXME: move updateUserStatus in participantPresenceChanged action
382
         UI.updateUserStatus(user, status);
379
         UI.updateUserStatus(user, status);
383
-    } else {
384
-        APP.store.dispatch(showParticipantJoinedNotification(displayName));
385
     }
380
     }
386
 
381
 
387
     // set initial display name
382
     // set initial display name

+ 10
- 2
react/features/base/participants/middleware.js Parādīt failu

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

Notiek ielāde…
Atcelt
Saglabāt