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:
parent
2ba0a801c4
commit
917957c1dc
5 changed files with 68 additions and 45 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue