make talking indicator display users with the same name

This commit is contained in:
KDSBrowne 2019-11-26 16:44:58 +00:00
parent 7e1727f652
commit 3cd81682f7
2 changed files with 10 additions and 7 deletions

View File

@ -31,13 +31,14 @@ class TalkingIndicator extends PureComponent {
const { intl, talkers, openPanel } = this.props;
if (!talkers) return null;
const talkingUserElements = Object.keys(talkers).map((name) => {
const talkingUserElements = Object.keys(talkers).map((id) => {
const {
talking,
color,
voiceUserId,
muted,
} = talkers[`${name}`];
callerName,
} = talkers[`${id}`];
const style = {
[styles.talker]: true,
@ -48,7 +49,7 @@ class TalkingIndicator extends PureComponent {
const ariaLabel = intl.formatMessage(talking
? intlMessages.isTalking : intlMessages.wasTalking, {
0: name,
0: callerName,
});
let icon = talking ? 'unmute' : 'blank';
@ -56,10 +57,10 @@ class TalkingIndicator extends PureComponent {
return (
<Button
key={_.uniqueId(`${name}-`)}
key={_.uniqueId(`${callerName}-`)}
className={cx(style)}
onClick={() => this.handleMuteUser(voiceUserId)}
label={name}
label={callerName}
aria-label={ariaLabel}
aria-describedby={talking ? 'description' : null}
color="primary"

View File

@ -25,20 +25,22 @@ export default withTracker(() => {
startTime: 1,
voiceUserId: 1,
muted: 1,
intId: 1,
},
}).fetch().sort(Service.sortVoiceUsers);
if (usersTalking) {
for (let i = 0; i < usersTalking.length; i += 1) {
const {
callerName, talking, color, voiceUserId, muted,
callerName, talking, color, voiceUserId, muted, intId,
} = usersTalking[i];
talkers[`${callerName}`] = {
talkers[`${intId}`] = {
color,
talking,
voiceUserId,
muted,
callerName,
};
}
}