make talking indicator display users with the same name
This commit is contained in:
parent
7e1727f652
commit
3cd81682f7
@ -31,13 +31,14 @@ class TalkingIndicator extends PureComponent {
|
|||||||
const { intl, talkers, openPanel } = this.props;
|
const { intl, talkers, openPanel } = this.props;
|
||||||
if (!talkers) return null;
|
if (!talkers) return null;
|
||||||
|
|
||||||
const talkingUserElements = Object.keys(talkers).map((name) => {
|
const talkingUserElements = Object.keys(talkers).map((id) => {
|
||||||
const {
|
const {
|
||||||
talking,
|
talking,
|
||||||
color,
|
color,
|
||||||
voiceUserId,
|
voiceUserId,
|
||||||
muted,
|
muted,
|
||||||
} = talkers[`${name}`];
|
callerName,
|
||||||
|
} = talkers[`${id}`];
|
||||||
|
|
||||||
const style = {
|
const style = {
|
||||||
[styles.talker]: true,
|
[styles.talker]: true,
|
||||||
@ -48,7 +49,7 @@ class TalkingIndicator extends PureComponent {
|
|||||||
|
|
||||||
const ariaLabel = intl.formatMessage(talking
|
const ariaLabel = intl.formatMessage(talking
|
||||||
? intlMessages.isTalking : intlMessages.wasTalking, {
|
? intlMessages.isTalking : intlMessages.wasTalking, {
|
||||||
0: name,
|
0: callerName,
|
||||||
});
|
});
|
||||||
|
|
||||||
let icon = talking ? 'unmute' : 'blank';
|
let icon = talking ? 'unmute' : 'blank';
|
||||||
@ -56,10 +57,10 @@ class TalkingIndicator extends PureComponent {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
key={_.uniqueId(`${name}-`)}
|
key={_.uniqueId(`${callerName}-`)}
|
||||||
className={cx(style)}
|
className={cx(style)}
|
||||||
onClick={() => this.handleMuteUser(voiceUserId)}
|
onClick={() => this.handleMuteUser(voiceUserId)}
|
||||||
label={name}
|
label={callerName}
|
||||||
aria-label={ariaLabel}
|
aria-label={ariaLabel}
|
||||||
aria-describedby={talking ? 'description' : null}
|
aria-describedby={talking ? 'description' : null}
|
||||||
color="primary"
|
color="primary"
|
||||||
|
@ -25,20 +25,22 @@ export default withTracker(() => {
|
|||||||
startTime: 1,
|
startTime: 1,
|
||||||
voiceUserId: 1,
|
voiceUserId: 1,
|
||||||
muted: 1,
|
muted: 1,
|
||||||
|
intId: 1,
|
||||||
},
|
},
|
||||||
}).fetch().sort(Service.sortVoiceUsers);
|
}).fetch().sort(Service.sortVoiceUsers);
|
||||||
|
|
||||||
if (usersTalking) {
|
if (usersTalking) {
|
||||||
for (let i = 0; i < usersTalking.length; i += 1) {
|
for (let i = 0; i < usersTalking.length; i += 1) {
|
||||||
const {
|
const {
|
||||||
callerName, talking, color, voiceUserId, muted,
|
callerName, talking, color, voiceUserId, muted, intId,
|
||||||
} = usersTalking[i];
|
} = usersTalking[i];
|
||||||
|
|
||||||
talkers[`${callerName}`] = {
|
talkers[`${intId}`] = {
|
||||||
color,
|
color,
|
||||||
talking,
|
talking,
|
||||||
voiceUserId,
|
voiceUserId,
|
||||||
muted,
|
muted,
|
||||||
|
callerName,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user