Browse Source

feat: make display name prompt platform independent

master
Bettenbuk Zoltan 6 years ago
parent
commit
c1598b7376
3 changed files with 10 additions and 14 deletions
  1. 0
    6
      conference.js
  2. 0
    8
      modules/UI/UI.js
  3. 10
    0
      react/features/base/conference/middleware.js

+ 0
- 6
conference.js View File

2200
 
2200
 
2201
         APP.keyboardshortcut.init();
2201
         APP.keyboardshortcut.init();
2202
 
2202
 
2203
-        if (config.requireDisplayName
2204
-                && !APP.conference.getLocalDisplayName()
2205
-                && !room.isHidden()) {
2206
-            APP.UI.promptDisplayName();
2207
-        }
2208
-
2209
         APP.store.dispatch(conferenceJoined(room));
2203
         APP.store.dispatch(conferenceJoined(room));
2210
 
2204
 
2211
         const displayName
2205
         const displayName

+ 0
- 8
modules/UI/UI.js View File

15
 
15
 
16
 import { getLocalParticipant } from '../../react/features/base/participants';
16
 import { getLocalParticipant } from '../../react/features/base/participants';
17
 import { toggleChat } from '../../react/features/chat';
17
 import { toggleChat } from '../../react/features/chat';
18
-import { openDisplayNamePrompt } from '../../react/features/display-name';
19
 import { setEtherpadHasInitialzied } from '../../react/features/etherpad';
18
 import { setEtherpadHasInitialzied } from '../../react/features/etherpad';
20
 import { setFilmstripVisible } from '../../react/features/filmstrip';
19
 import { setFilmstripVisible } from '../../react/features/filmstrip';
21
 import { setNotificationsEnabled } from '../../react/features/notifications';
20
 import { setNotificationsEnabled } from '../../react/features/notifications';
549
     VideoLayout.onLastNEndpointsChanged(leavingIds, enteringIds);
548
     VideoLayout.onLastNEndpointsChanged(leavingIds, enteringIds);
550
 };
549
 };
551
 
550
 
552
-/**
553
- * Prompt user for nickname.
554
- */
555
-UI.promptDisplayName = () => {
556
-    APP.store.dispatch(openDisplayNamePrompt(undefined));
557
-};
558
-
559
 /**
551
 /**
560
  * Update audio level visualization for specified user.
552
  * Update audio level visualization for specified user.
561
  * @param {string} id user id
553
  * @param {string} id user id

+ 10
- 0
react/features/base/conference/middleware.js View File

1
 // @flow
1
 // @flow
2
 
2
 
3
 import { reloadNow } from '../../app';
3
 import { reloadNow } from '../../app';
4
+import { openDisplayNamePrompt } from '../../display-name';
5
+
4
 import {
6
 import {
5
     ACTION_PINNED,
7
     ACTION_PINNED,
6
     ACTION_UNPINNED,
8
     ACTION_UNPINNED,
12
 import { CONNECTION_ESTABLISHED, CONNECTION_FAILED } from '../connection';
14
 import { CONNECTION_ESTABLISHED, CONNECTION_FAILED } from '../connection';
13
 import { JitsiConferenceErrors } from '../lib-jitsi-meet';
15
 import { JitsiConferenceErrors } from '../lib-jitsi-meet';
14
 import {
16
 import {
17
+    getLocalParticipant,
15
     getParticipantById,
18
     getParticipantById,
16
     getPinnedParticipant,
19
     getPinnedParticipant,
17
     PARTICIPANT_UPDATED,
20
     PARTICIPANT_UPDATED,
186
     const result = next(action);
189
     const result = next(action);
187
     const { conference } = action;
190
     const { conference } = action;
188
     const { pendingSubjectChange } = getState()['features/base/conference'];
191
     const { pendingSubjectChange } = getState()['features/base/conference'];
192
+    const { requireDisplayName } = getState()['features/base/config'];
189
 
193
 
190
     pendingSubjectChange && dispatch(setSubject(pendingSubjectChange));
194
     pendingSubjectChange && dispatch(setSubject(pendingSubjectChange));
191
 
195
 
199
     };
203
     };
200
     window.addEventListener('beforeunload', beforeUnloadHandler);
204
     window.addEventListener('beforeunload', beforeUnloadHandler);
201
 
205
 
206
+    if (requireDisplayName
207
+        && !getLocalParticipant(getState)?.name
208
+        && !conference.isHidden()) {
209
+        dispatch(openDisplayNamePrompt(undefined));
210
+    }
211
+
202
     return result;
212
     return result;
203
 }
213
 }
204
 
214
 

Loading…
Cancel
Save