Skip to content

Commit

Permalink
Merge pull request #6303 from vector-im/luke/fix-group-invite-flow
Browse files Browse the repository at this point in the history
Fix bug where cannot send group invite on GroupMemberInfo phase
  • Loading branch information
lukebarnard1 committed Mar 12, 2018
2 parents 5eae913 + afb9fdf commit dfb0eb5
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions src/components/structures/RightPanel.js
Expand Up @@ -167,19 +167,25 @@ module.exports = React.createClass({
return;
}

if (this.state.phase === this.Phase.GroupMemberList) {
showGroupInviteDialog(this.props.groupId);
} else if (this.state.phase === this.Phase.GroupRoomList) {
showGroupAddRoomDialog(this.props.groupId).then(() => {
this.forceUpdate();
});
} else {
// call AddressPickerDialog
dis.dispatch({
action: 'view_invite',
roomId: this.props.roomId,
// call AddressPickerDialog
dis.dispatch({
action: 'view_invite',
roomId: this.props.roomId,
});
},

onInviteToGroupButtonClick: function() {
showGroupInviteDialog(this.props.groupId).then(() => {
this.setState({
phase: this.Phase.GroupMemberList,
});
}
});
},

onAddRoomToGroupButtonClick: function() {
showGroupAddRoomDialog(this.props.groupId).then(() => {
this.forceUpdate();
});
},

onRoomStateMember: function(ev, state, member) {
Expand Down Expand Up @@ -233,6 +239,10 @@ module.exports = React.createClass({
this.setState({
phase: this.Phase.GroupRoomList,
});
} else if (payload.action === "view_group_member_list") {
this.setState({
phase: this.Phase.GroupMemberList,
});
} else if (payload.action === "view_group_user") {
this.setState({
phase: this.Phase.GroupMemberInfo,
Expand Down Expand Up @@ -376,14 +386,14 @@ module.exports = React.createClass({

if (this.props.groupId && this.state.isUserPrivilegedInGroup) {
inviteGroup = isPhaseGroup ? (
<AccessibleButton className="mx_RightPanel_invite" onClick={this.onInviteButtonClick}>
<AccessibleButton className="mx_RightPanel_invite" onClick={this.onInviteToGroupButtonClick}>
<div className="mx_RightPanel_icon" >
<TintableSvg src="img/icon-invite-people.svg" width="35" height="35" />
</div>
<div className="mx_RightPanel_message">{ _t('Invite to this community') }</div>
</AccessibleButton>
) : (
<AccessibleButton className="mx_RightPanel_invite" onClick={this.onInviteButtonClick}>
<AccessibleButton className="mx_RightPanel_invite" onClick={this.onAddRoomToGroupButtonClick}>
<div className="mx_RightPanel_icon" >
<TintableSvg src="img/icons-room-add.svg" width="35" height="35" />
</div>
Expand Down

0 comments on commit dfb0eb5

Please sign in to comment.