Simplified the toggleSelfVoice code.
This commit is contained in:
parent
483f543f17
commit
7968a55bf3
@ -25,7 +25,6 @@ const propTypes = {
|
|||||||
assignPresenter: PropTypes.func.isRequired,
|
assignPresenter: PropTypes.func.isRequired,
|
||||||
removeUser: PropTypes.func.isRequired,
|
removeUser: PropTypes.func.isRequired,
|
||||||
toggleVoice: PropTypes.func.isRequired,
|
toggleVoice: PropTypes.func.isRequired,
|
||||||
toggleSelfVoice: PropTypes.func.isRequired,
|
|
||||||
changeRole: PropTypes.func.isRequired,
|
changeRole: PropTypes.func.isRequired,
|
||||||
roving: PropTypes.func.isRequired,
|
roving: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
@ -66,7 +65,6 @@ class UserList extends Component {
|
|||||||
assignPresenter={this.props.assignPresenter}
|
assignPresenter={this.props.assignPresenter}
|
||||||
removeUser={this.props.removeUser}
|
removeUser={this.props.removeUser}
|
||||||
toggleVoice={this.props.toggleVoice}
|
toggleVoice={this.props.toggleVoice}
|
||||||
toggleSelfVoice={this.props.toggleSelfVoice}
|
|
||||||
changeRole={this.props.changeRole}
|
changeRole={this.props.changeRole}
|
||||||
meeting={this.props.meeting}
|
meeting={this.props.meeting}
|
||||||
getAvailableActions={this.props.getAvailableActions}
|
getAvailableActions={this.props.getAvailableActions}
|
||||||
|
@ -20,7 +20,6 @@ const propTypes = {
|
|||||||
assignPresenter: PropTypes.func.isRequired,
|
assignPresenter: PropTypes.func.isRequired,
|
||||||
removeUser: PropTypes.func.isRequired,
|
removeUser: PropTypes.func.isRequired,
|
||||||
toggleVoice: PropTypes.func.isRequired,
|
toggleVoice: PropTypes.func.isRequired,
|
||||||
toggleSelfVoice: PropTypes.func.isRequired,
|
|
||||||
changeRole: PropTypes.func.isRequired,
|
changeRole: PropTypes.func.isRequired,
|
||||||
roving: PropTypes.func.isRequired,
|
roving: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
@ -40,7 +39,6 @@ const UserListContainer = (props) => {
|
|||||||
assignPresenter,
|
assignPresenter,
|
||||||
removeUser,
|
removeUser,
|
||||||
toggleVoice,
|
toggleVoice,
|
||||||
toggleSelfVoice,
|
|
||||||
changeRole,
|
changeRole,
|
||||||
roving,
|
roving,
|
||||||
} = props;
|
} = props;
|
||||||
@ -56,7 +54,6 @@ const UserListContainer = (props) => {
|
|||||||
assignPresenter={assignPresenter}
|
assignPresenter={assignPresenter}
|
||||||
removeUser={removeUser}
|
removeUser={removeUser}
|
||||||
toggleVoice={toggleVoice}
|
toggleVoice={toggleVoice}
|
||||||
toggleSelfVoice={toggleSelfVoice}
|
|
||||||
changeRole={changeRole}
|
changeRole={changeRole}
|
||||||
getAvailableActions={getAvailableActions}
|
getAvailableActions={getAvailableActions}
|
||||||
normalizeEmojiName={normalizeEmojiName}
|
normalizeEmojiName={normalizeEmojiName}
|
||||||
@ -83,7 +80,6 @@ export default withTracker(({ params }) => ({
|
|||||||
assignPresenter: Service.assignPresenter,
|
assignPresenter: Service.assignPresenter,
|
||||||
removeUser: Service.removeUser,
|
removeUser: Service.removeUser,
|
||||||
toggleVoice: Service.toggleVoice,
|
toggleVoice: Service.toggleVoice,
|
||||||
toggleSelfVoice: Service.toggleSelfVoice,
|
|
||||||
changeRole: Service.changeRole,
|
changeRole: Service.changeRole,
|
||||||
roving: Service.roving,
|
roving: Service.roving,
|
||||||
}))(UserListContainer);
|
}))(UserListContainer);
|
||||||
|
@ -309,9 +309,7 @@ const removeUser = (userId) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const toggleVoice = (userId) => { makeCall('toggleVoice', userId); };
|
const toggleVoice = (userId) => { userId === Auth.userID ? makeCall('toggleSelfVoice') : makeCall('toggleVoice', userId); };
|
||||||
|
|
||||||
const toggleSelfVoice = () => { makeCall('toggleSelfVoice'); };
|
|
||||||
|
|
||||||
const changeRole = (userId, role) => { makeCall('changeRole', userId, role); };
|
const changeRole = (userId, role) => { makeCall('changeRole', userId, role); };
|
||||||
|
|
||||||
@ -356,7 +354,6 @@ export default {
|
|||||||
assignPresenter,
|
assignPresenter,
|
||||||
removeUser,
|
removeUser,
|
||||||
toggleVoice,
|
toggleVoice,
|
||||||
toggleSelfVoice,
|
|
||||||
changeRole,
|
changeRole,
|
||||||
getUsers,
|
getUsers,
|
||||||
getOpenChats,
|
getOpenChats,
|
||||||
|
@ -22,7 +22,6 @@ const propTypes = {
|
|||||||
assignPresenter: PropTypes.func.isRequired,
|
assignPresenter: PropTypes.func.isRequired,
|
||||||
removeUser: PropTypes.func.isRequired,
|
removeUser: PropTypes.func.isRequired,
|
||||||
toggleVoice: PropTypes.func.isRequired,
|
toggleVoice: PropTypes.func.isRequired,
|
||||||
toggleSelfVoice: PropTypes.func.isRequired,
|
|
||||||
changeRole: PropTypes.func.isRequired,
|
changeRole: PropTypes.func.isRequired,
|
||||||
roving: PropTypes.func.isRequired,
|
roving: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
@ -60,7 +59,6 @@ class UserContent extends Component {
|
|||||||
assignPresenter={this.props.assignPresenter}
|
assignPresenter={this.props.assignPresenter}
|
||||||
removeUser={this.props.removeUser}
|
removeUser={this.props.removeUser}
|
||||||
toggleVoice={this.props.toggleVoice}
|
toggleVoice={this.props.toggleVoice}
|
||||||
toggleSelfVoice={this.props.toggleSelfVoice}
|
|
||||||
changeRole={this.props.changeRole}
|
changeRole={this.props.changeRole}
|
||||||
getAvailableActions={this.props.getAvailableActions}
|
getAvailableActions={this.props.getAvailableActions}
|
||||||
normalizeEmojiName={this.props.normalizeEmojiName}
|
normalizeEmojiName={this.props.normalizeEmojiName}
|
||||||
|
@ -19,7 +19,6 @@ const propTypes = {
|
|||||||
assignPresenter: PropTypes.func.isRequired,
|
assignPresenter: PropTypes.func.isRequired,
|
||||||
removeUser: PropTypes.func.isRequired,
|
removeUser: PropTypes.func.isRequired,
|
||||||
toggleVoice: PropTypes.func.isRequired,
|
toggleVoice: PropTypes.func.isRequired,
|
||||||
toggleSelfVoice: PropTypes.func.isRequired,
|
|
||||||
changeRole: PropTypes.func.isRequired,
|
changeRole: PropTypes.func.isRequired,
|
||||||
getAvailableActions: PropTypes.func.isRequired,
|
getAvailableActions: PropTypes.func.isRequired,
|
||||||
normalizeEmojiName: PropTypes.func.isRequired,
|
normalizeEmojiName: PropTypes.func.isRequired,
|
||||||
@ -143,7 +142,6 @@ class UserParticipants extends Component {
|
|||||||
setEmojiStatus,
|
setEmojiStatus,
|
||||||
removeUser,
|
removeUser,
|
||||||
toggleVoice,
|
toggleVoice,
|
||||||
toggleSelfVoice,
|
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
const userActions =
|
const userActions =
|
||||||
@ -170,12 +168,12 @@ class UserParticipants extends Component {
|
|||||||
},
|
},
|
||||||
mute: {
|
mute: {
|
||||||
label: () => intl.formatMessage(intlMessages.MuteUserAudioLabel),
|
label: () => intl.formatMessage(intlMessages.MuteUserAudioLabel),
|
||||||
handler: (user) => { user.id == currentUser.id ? toggleSelfVoice() : toggleVoice(user.id); },
|
handler: (user) => toggleVoice(user.id),
|
||||||
icon: 'audio_off',
|
icon: 'audio_off',
|
||||||
},
|
},
|
||||||
unmute: {
|
unmute: {
|
||||||
label: () => intl.formatMessage(intlMessages.UnmuteUserAudioLabel),
|
label: () => intl.formatMessage(intlMessages.UnmuteUserAudioLabel),
|
||||||
handler: (user) => { user.id == currentUser.id ? toggleSelfVoice() : toggleVoice(user.id); },
|
handler: (user) => toggleVoice(user.id),
|
||||||
icon: 'audio_on',
|
icon: 'audio_on',
|
||||||
},
|
},
|
||||||
promote: {
|
promote: {
|
||||||
|
Loading…
Reference in New Issue
Block a user