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,6 +1,7 @@
1 1
 // @flow
2 2
 
3 3
 import React from 'react';
4
+import { useSelector } from 'react-redux';
4 5
 
5 6
 import { isParticipantModerator } from '../../../base/participants';
6 7
 import ParticipantItem from '../../../participants-pane/components/native/ParticipantItem';
@@ -11,15 +12,19 @@ type Props = {
11 12
      * Participant to be displayed.
12 13
      */
13 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 30
 export default BreakoutRoomParticipantItem;

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

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

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

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

Loading…
Cancel
Save