From afb9fdf4ecf0f7a4935e4bede8d77016939c4a07 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Mon, 12 Mar 2018 17:18:30 +0000 Subject: [PATCH] Fix bug where cannot send group invite on GroupMemberInfo phase by not reusing the same function and invoking separate conditions to decide what the function does but instead using different functions. Also, show the GroupMemberList after inviting a member, otherwise we might end up looking at the member we were already looking at instead of the updated list of members. --- src/components/structures/RightPanel.js | 38 ++++++++++++++++--------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/src/components/structures/RightPanel.js b/src/components/structures/RightPanel.js index 55f588f21..39463a670 100644 --- a/src/components/structures/RightPanel.js +++ b/src/components/structures/RightPanel.js @@ -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(); + // call AddressPickerDialog + dis.dispatch({ + action: 'view_invite', + roomId: this.props.roomId, + }); + }, + + onInviteToGroupButtonClick: function() { + showGroupInviteDialog(this.props.groupId).then(() => { + this.setState({ + phase: this.Phase.GroupMemberList, }); - } else { - // call AddressPickerDialog - dis.dispatch({ - action: 'view_invite', - roomId: this.props.roomId, - }); - } + }); + }, + + onAddRoomToGroupButtonClick: function() { + showGroupAddRoomDialog(this.props.groupId).then(() => { + this.forceUpdate(); + }); }, onRoomStateMember: function(ev, state, member) { @@ -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, @@ -376,14 +386,14 @@ module.exports = React.createClass({ if (this.props.groupId && this.state.isUserPrivilegedInGroup) { inviteGroup = isPhaseGroup ? ( - +
{ _t('Invite to this community') }
) : ( - +