Modify the group store to include group rooms

and modify components to use this new part of the store such that feedback can be given
when adding or removing a room from the room list.
This commit is contained in:
Luke Barnard 2017-10-05 14:30:04 +01:00
parent 2ba0a801c4
commit 917957c1dc
5 changed files with 68 additions and 45 deletions

View file

@ -21,6 +21,7 @@ import PropTypes from 'prop-types';
import sdk from '../../../index';
import dis from '../../../dispatcher';
import { GroupRoomType } from '../../../groups';
import GroupStoreCache from '../../../stores/GroupStoreCache';
import Modal from '../../../Modal';
const GroupRoomTile = React.createClass({
@ -49,10 +50,10 @@ const GroupRoomTile = React.createClass({
removeRoomFromGroup: function() {
const groupId = this.props.groupId;
const groupStore = GroupStoreCache.getGroupStore(this.context.matrixClient, groupId);
const roomName = this.state.name;
const roomId = this.props.groupRoom.roomId;
this.context.matrixClient
.removeRoomFromGroup(groupId, roomId)
groupStore.removeRoomFromGroup(roomId)
.catch((err) => {
console.error(`Error whilst removing ${roomId} from ${groupId}`, err);
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");