Merge pull request #5707 from vector-im/luke/allow-guest-view-group

getGroupStore no longer needs a matrix client
This commit is contained in:
Luke Barnard 2017-11-28 14:09:39 +00:00 committed by GitHub
commit 63bedc440b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -127,7 +127,7 @@ module.exports = React.createClass({
return { return {
phase: this.props.groupId ? this.Phase.GroupMemberList : this.Phase.RoomMemberList, phase: this.props.groupId ? this.Phase.GroupMemberList : this.Phase.RoomMemberList,
isUserPrivilegedInGroup: null, isUserPrivilegedInGroup: null,
} };
}, },
componentWillReceiveProps(newProps) { componentWillReceiveProps(newProps) {
@ -139,9 +139,7 @@ module.exports = React.createClass({
_initGroupStore(groupId) { _initGroupStore(groupId) {
if (!groupId) return; if (!groupId) return;
this._groupStore = GroupStoreCache.getGroupStore( this._groupStore = GroupStoreCache.getGroupStore(groupId);
this.context.matrixClient, groupId,
);
this._groupStore.registerListener(this.onGroupStoreUpdated); this._groupStore.registerListener(this.onGroupStoreUpdated);
}, },
@ -151,7 +149,7 @@ module.exports = React.createClass({
} }
}, },
onGroupStoreUpdated: function(){ onGroupStoreUpdated: function() {
this.setState({ this.setState({
isUserPrivilegedInGroup: this._groupStore.isUserPrivileged(), isUserPrivilegedInGroup: this._groupStore.isUserPrivileged(),
}); });