Fetch group data when leaving or joining to update the view

This commit is contained in:
Luke Barnard 2018-04-10 10:03:54 +01:00
parent 2da45277cd
commit 42141f7da7
2 changed files with 28 additions and 3 deletions

View file

@ -678,7 +678,7 @@ export default React.createClass({
_onRejectInviteClick: function() {
this.setState({membershipBusy: true});
this._matrixClient.leaveGroup(this.props.groupId).then(() => {
this._groupStore.leaveGroup().then(() => {
// don't reset membershipBusy here: wait for the membership change to come down the sync
}).catch((e) => {
this.setState({membershipBusy: false});
@ -692,7 +692,8 @@ export default React.createClass({
_onJoinClick: function() {
this.setState({membershipBusy: true});
this._matrixClient.joinGroup(this.props.groupId).then(() => {
this._groupStore.joinGroup().then(() => {
// don't reset membershipBusy here: wait for the membership change to come down the sync
}).catch((e) => {
this.setState({membershipBusy: false});
@ -715,7 +716,7 @@ export default React.createClass({
if (!confirmed) return;
this.setState({membershipBusy: true});
this._matrixClient.leaveGroup(this.props.groupId).then(() => {
this._groupStore.leaveGroup().then(() => {
// don't reset membershipBusy here: wait for the membership change to come down the sync
}).catch((e) => {
this.setState({membershipBusy: false});