diff --git a/src/components/views/elements/TagTile.js b/src/components/views/elements/TagTile.js index 4ea1b65123..c5fdea0a54 100644 --- a/src/components/views/elements/TagTile.js +++ b/src/components/views/elements/TagTile.js @@ -24,6 +24,7 @@ import { isOnlyCtrlOrCmdIgnoreShiftKeyEvent } from '../../../Keyboard'; import ContextualMenu from '../../structures/ContextualMenu'; import FlairStore from '../../../stores/FlairStore'; +import GroupStore from '../../../stores/GroupStore'; // A class for a child of TagPanel (possibly wrapped in a DNDTagTile) that represents // a thing to click on for the user to filter the visible rooms in the RoomList to: @@ -57,6 +58,8 @@ export default React.createClass({ if (this.props.tag[0] === '+') { FlairStore.addListener('updateGroupProfile', this._onFlairStoreUpdated); this._onFlairStoreUpdated(); + // New rooms or members may have been added to the group, fetch async + this._refreshGroup(this.props.tag); } }, @@ -80,6 +83,11 @@ export default React.createClass({ }); }, + _refreshGroup(groupId) { + GroupStore.refreshGroupRooms(groupId); + GroupStore.refreshGroupMembers(groupId); + }, + onClick: function(e) { e.preventDefault(); e.stopPropagation(); @@ -89,6 +97,10 @@ export default React.createClass({ ctrlOrCmdKey: isOnlyCtrlOrCmdIgnoreShiftKeyEvent(e), shiftKey: e.shiftKey, }); + if (this.props.tag[0] === '+') { + // New rooms or members may have been added to the group, fetch async + this._refreshGroup(this.props.tag); + } }, onContextButtonClick: function(e) { diff --git a/src/stores/GroupStore.js b/src/stores/GroupStore.js index b0c7f8f19f..e750dc1a6b 100644 --- a/src/stores/GroupStore.js +++ b/src/stores/GroupStore.js @@ -233,6 +233,14 @@ class GroupStore extends EventEmitter { (this._state[this.STATE_KEY.Summary][groupId] || {}).user.is_privileged : null; } + refreshGroupRooms(groupId) { + return this._fetchResource(this.STATE_KEY.GroupRooms, groupId); + } + + refreshGroupMembers(groupId) { + return this._fetchResource(this.STATE_KEY.GroupMembers, groupId); + } + addRoomToGroup(groupId, roomId, isPublic) { return MatrixClientPeg.get() .addRoomToGroup(groupId, roomId, isPublic)