Sfoglia il codice sorgente

feat: make display name prompt platform independent

master
Bettenbuk Zoltan 5 anni fa
parent
commit
c1598b7376
3 ha cambiato i file con 10 aggiunte e 14 eliminazioni
  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 Vedi File

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

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

@@ -15,7 +15,6 @@ import Filmstrip from './videolayout/Filmstrip';
15 15
 
16 16
 import { getLocalParticipant } from '../../react/features/base/participants';
17 17
 import { toggleChat } from '../../react/features/chat';
18
-import { openDisplayNamePrompt } from '../../react/features/display-name';
19 18
 import { setEtherpadHasInitialzied } from '../../react/features/etherpad';
20 19
 import { setFilmstripVisible } from '../../react/features/filmstrip';
21 20
 import { setNotificationsEnabled } from '../../react/features/notifications';
@@ -549,13 +548,6 @@ UI.handleLastNEndpoints = function(leavingIds, enteringIds) {
549 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 552
  * Update audio level visualization for specified user.
561 553
  * @param {string} id user id

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

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

Loading…
Annulla
Salva