diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index e44a17a317..fb6d36ce35 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -66,7 +66,6 @@ module.exports = React.createClass({ collapse_rhs: false, ready: false, width: 10000, - autoPeek: true, // by default, we peek into rooms when we try to join them }; if (s.logged_in) { if (MatrixClientPeg.get().getRooms().length) { diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index c46149bfeb..6dbff018ef 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -60,6 +60,9 @@ module.exports = React.createClass({ displayName: 'RoomView', propTypes: { ConferenceHandler: React.PropTypes.any, + roomId: React.PropTypes.string, + autoPeek: React.PropTypes.bool, // Now unused, left here temporarily to avoid merge conflicts with @richvdh's branch. + roomId: React.PropTypes.string.isRequired, // id of an event to jump to. If not given, will use the read-up-to-marker. @@ -77,6 +80,12 @@ module.exports = React.createClass({ autoPeek: React.PropTypes.bool, // should we try to peek the room on mount, or has whoever invoked us already initiated a peek? }, + getDefaultProps: function() { + return { + autoPeek: true, + } + }, + /* properties in RoomView objects include: * * eventNodes: a map from event id to DOM node representing that event @@ -487,6 +496,7 @@ module.exports = React.createClass({ this._updateTabCompleteList(this.state.room); var room = MatrixClientPeg.get().getRoom(this.props.roomId); + if (!room) return; var me = MatrixClientPeg.get().credentials.userId; if (this.state.joining && room.hasMembershipState(me, "join")) { this.setState({