Merge pull request #10848 from mariogasparoni/v2.2.x-release

Fix audio modal buttons (MIC/LISTEN) after errors AND prevent Error 1006 when user has two or more occurrences of ':'
This commit is contained in:
Anton Georgiev 2020-11-17 15:14:20 -05:00 committed by GitHub
commit aaf3878a4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 3 deletions

View File

@ -145,10 +145,13 @@ class SIPSession {
sessionToken,
} = this.user;
const encodedName =
btoa && name ? btoa(name) : name;
const callerIdName = [
`${userId}_${getAudioSessionNumber()}`,
'bbbID',
isListenOnly ? `LISTENONLY-${name}` : name,
isListenOnly ? `LISTENONLY-${encodedName}` : encodedName,
].join('-').replace(/"/g, "'");
this.user.callerIdName = callerIdName;

View File

@ -183,6 +183,7 @@ class AudioModal extends Component {
componentDidUpdate(prevProps) {
const { autoplayBlocked, closeModal } = this.props;
if (autoplayBlocked !== prevProps.autoplayBlocked) {
autoplayBlocked ? this.setState({ content: 'autoplayBlocked' }) : closeModal();
}
@ -246,13 +247,14 @@ class AudioModal extends Component {
const {
joinEchoTest,
isConnecting,
} = this.props;
const {
disableActions,
} = this.state;
if (disableActions) return;
if (disableActions && isConnecting) return;
this.setState({
hasError: false,

View File

@ -1,6 +1,7 @@
import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import VoiceUsers from '/imports/api/voice-users';
import Users from '/imports/api/users'
import Auth from '/imports/ui/services/auth';
import { debounce } from 'lodash';
import TalkingIndicator from './component';
@ -36,12 +37,16 @@ export default withTracker(() => {
callerName, talking, color, voiceUserId, muted, intId,
} = usersTalking[i];
const user = Users.findOne({ userId: voiceUserId });
const _name = user ? user.name : 'USER';
talkers[`${intId}`] = {
color,
talking,
voiceUserId,
muted,
callerName,
callerName: _name,
};
}
}