diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index 7656149fc6..9a2aa1fea5 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -73,9 +73,6 @@ var RoomSubList = React.createClass({ order: React.PropTypes.string.isRequired, - // undefined if no room is selected (eg we are showing settings) - selectedRoom: React.PropTypes.string, - startAsHidden: React.PropTypes.bool, showSpinner: React.PropTypes.bool, // true to show a spinner if 0 elements when expanded collapsed: React.PropTypes.bool.isRequired, // is LeftPanel collapsed? @@ -104,12 +101,14 @@ var RoomSubList = React.createClass({ componentWillMount: function() { constantTimeDispatcher.register("RoomSubList.sort", this.props.tagName, this.onSort); + constantTimeDispatcher.register("RoomSubList.refreshHeader", this.props.tagName, this.onRefresh); this.sortList(this.applySearchFilter(this.props.list, this.props.searchFilter), this.props.order); this._fixUndefinedOrder(this.props.list); }, componentWillUnmount: function() { constantTimeDispatcher.unregister("RoomSubList.sort", this.props.tagName, this.onSort); + constantTimeDispatcher.unregister("RoomSubList.refreshHeader", this.props.tagName, this.onRefresh); }, componentWillReceiveProps: function(newProps) { @@ -124,6 +123,10 @@ var RoomSubList = React.createClass({ // we deliberately don't waste time trying to fix undefined ordering here }, + onRefresh: function() { + this.forceUpdate(); + }, + applySearchFilter: function(list, filter) { if (filter === "") return list; return list.filter((room) => { @@ -370,7 +373,6 @@ var RoomSubList = React.createClass({ var self = this; var DNDRoomTile = sdk.getComponent("rooms.DNDRoomTile"); return this.state.sortedList.map(function(room) { - var selected = room.roomId == self.props.selectedRoom; // XXX: is it evil to pass in self as a prop to RoomTile? return ( 0 || self.props.label === 'Invites' } isInvite={ self.props.label === 'Invites' } refreshSubList={ self._updateSubListCount } incomingCall={ null } diff --git a/src/components/structures/RoomSubListHeader.js b/src/components/structures/RoomSubListHeader.js index 054480f863..5618b39b85 100644 --- a/src/components/structures/RoomSubListHeader.js +++ b/src/components/structures/RoomSubListHeader.js @@ -50,16 +50,16 @@ module.exports = React.createClass({ }, componentWillMount: function() { - constantTimeDispatcher.register("RoomSubList.refreshHeader", this.props.tagName, this.onRefresh); + // constantTimeDispatcher.register("RoomSubList.refreshHeader", this.props.tagName, this.onRefresh); }, componentWillUnmount: function() { - constantTimeDispatcher.unregister("RoomSubList.refreshHeader", this.props.tagName, this.onRefresh); + // constantTimeDispatcher.unregister("RoomSubList.refreshHeader", this.props.tagName, this.onRefresh); }, - onRefresh: function() { - this.forceUpdate(); - }, + // onRefresh: function() { + // this.forceUpdate(); + // }, render: function() { var TintableSvg = sdk.getComponent("elements.TintableSvg");