Browse Source

fix(breakout-rooms) make sure participants in breakout rooms have a display name

master
Saúl Ibarra Corretgé 3 years ago
parent
commit
591eab7c97

+ 14
- 9
react/features/breakout-rooms/components/native/BreakoutRoomParticipantItem.js View File

1
 // @flow
1
 // @flow
2
 
2
 
3
 import React from 'react';
3
 import React from 'react';
4
+import { useSelector } from 'react-redux';
4
 
5
 
5
 import { isParticipantModerator } from '../../../base/participants';
6
 import { isParticipantModerator } from '../../../base/participants';
6
 import ParticipantItem from '../../../participants-pane/components/native/ParticipantItem';
7
 import ParticipantItem from '../../../participants-pane/components/native/ParticipantItem';
11
      * Participant to be displayed.
12
      * Participant to be displayed.
12
      */
13
      */
13
     item: Object
14
     item: Object
14
-}
15
+};
15
 
16
 
16
-const BreakoutRoomParticipantItem = ({ item }: Props) => (
17
-    <ParticipantItem
18
-        displayName = { item.displayName }
19
-        isKnockingParticipant = { false }
20
-        isModerator = { isParticipantModerator(item) }
21
-        key = { item.jid }
22
-        participantID = { item.jid } />
23
-);
17
+const BreakoutRoomParticipantItem = ({ item }: Props) => {
18
+    const { defaultRemoteDisplayName } = useSelector(state => state['features/base/config']);
19
+
20
+    return (
21
+        <ParticipantItem
22
+            displayName = { item.displayName || defaultRemoteDisplayName }
23
+            isKnockingParticipant = { false }
24
+            isModerator = { isParticipantModerator(item) }
25
+            key = { item.jid }
26
+            participantID = { item.jid } />
27
+    );
28
+};
24
 
29
 
25
 export default BreakoutRoomParticipantItem;
30
 export default BreakoutRoomParticipantItem;

+ 2
- 1
react/features/breakout-rooms/components/native/CollapsibleRoom.js View File

64
                 data = { Object.values(room.participants || {}) }
64
                 data = { Object.values(room.participants || {}) }
65
                 horizontal = { false }
65
                 horizontal = { false }
66
                 keyExtractor = { _keyExtractor }
66
                 keyExtractor = { _keyExtractor }
67
-                renderItem = { BreakoutRoomParticipantItem }
67
+                // eslint-disable-next-line react/jsx-no-bind
68
+                renderItem = { item => <BreakoutRoomParticipantItem item = { item } /> }
68
                 showsHorizontalScrollIndicator = { false }
69
                 showsHorizontalScrollIndicator = { false }
69
                 windowSize = { 2 } />}
70
                 windowSize = { 2 } />}
70
         </View>
71
         </View>

+ 3
- 1
react/features/breakout-rooms/components/web/CollapsibleRoom.js View File

4
 import clsx from 'clsx';
4
 import clsx from 'clsx';
5
 import React, { useCallback, useState } from 'react';
5
 import React, { useCallback, useState } from 'react';
6
 import { useTranslation } from 'react-i18next';
6
 import { useTranslation } from 'react-i18next';
7
+import { useSelector } from 'react-redux';
7
 
8
 
8
 import { ListItem } from '../../../base/components';
9
 import { ListItem } from '../../../base/components';
9
 import { Icon, IconArrowDown, IconArrowUp } from '../../../base/icons';
10
 import { Icon, IconArrowDown, IconArrowUp } from '../../../base/icons';
88
     const raiseMenu = useCallback(target => {
89
     const raiseMenu = useCallback(target => {
89
         onRaiseMenu(target);
90
         onRaiseMenu(target);
90
     }, [ onRaiseMenu ]);
91
     }, [ onRaiseMenu ]);
92
+    const { defaultRemoteDisplayName } = useSelector(state => state['features/base/config']);
91
 
93
 
92
     const arrow = (<div className = { styles.arrowContainer }>
94
     const arrow = (<div className = { styles.arrowContainer }>
93
         <Icon
95
         <Icon
116
             {!collapsed && room?.participants
118
             {!collapsed && room?.participants
117
                 && Object.values(room?.participants || {}).map((p: Object) => (
119
                 && Object.values(room?.participants || {}).map((p: Object) => (
118
                     <ParticipantItem
120
                     <ParticipantItem
119
-                        displayName = { p.displayName }
121
+                        displayName = { p.displayName || defaultRemoteDisplayName }
120
                         key = { p.jid }
122
                         key = { p.jid }
121
                         local = { false }
123
                         local = { false }
122
                         participantID = { p.jid } />
124
                         participantID = { p.jid } />

Loading…
Cancel
Save