pass the RoomViewStore down with a prop instead of global var.

this will allow to have more than 1 RoomView further on
This commit is contained in:
Bruno Windels 2018-11-07 13:24:35 +01:00
parent 869c81eb90
commit df8539d6bc
7 changed files with 32 additions and 30 deletions

View file

@ -39,7 +39,6 @@ import Unread from '../../../Unread';
import { findReadReceiptFromUserId } from '../../../utils/Receipt';
import withMatrixClient from '../../../wrappers/withMatrixClient';
import AccessibleButton from '../elements/AccessibleButton';
import RoomViewStore from '../../../stores/RoomViewStore';
import SdkConfig from '../../../SdkConfig';
module.exports = withMatrixClient(React.createClass({
@ -48,6 +47,7 @@ module.exports = withMatrixClient(React.createClass({
propTypes: {
matrixClient: PropTypes.object.isRequired,
member: PropTypes.object.isRequired,
roomId: PropTypes.string,
},
getInitialState: function() {
@ -711,7 +711,7 @@ module.exports = withMatrixClient(React.createClass({
}
if (!member || !member.membership || member.membership === 'leave') {
const roomId = member && member.roomId ? member.roomId : RoomViewStore.getRoomId();
const roomId = member && member.roomId ? member.roomId : this.props.roomId;
const onInviteUserButton = async() => {
try {
await cli.invite(roomId, member.userId);