Merge pull request #6176 from vector-im/luke/fix-invites-not-appearing
Only use DNDRoomTile for editable sub lists
This commit is contained in:
commit
fc4da3e3bf
|
@ -194,26 +194,27 @@ var RoomSubList = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
makeRoomTiles: function() {
|
makeRoomTiles: function() {
|
||||||
var self = this;
|
const DNDRoomTile = sdk.getComponent("rooms.DNDRoomTile");
|
||||||
var DNDRoomTile = sdk.getComponent("rooms.DNDRoomTile");
|
const RoomTile = sdk.getComponent("rooms.RoomTile");
|
||||||
return this.state.sortedList.map(function(room, index) {
|
return this.state.sortedList.map((room, index) => {
|
||||||
// XXX: is it evil to pass in self as a prop to RoomTile?
|
// XXX: is it evil to pass in this as a prop to RoomTile? Yes.
|
||||||
return (
|
|
||||||
<DNDRoomTile
|
// We should only use <DNDRoomTile /> when editable
|
||||||
|
const RoomTileComponent = this.props.editable ? DNDRoomTile : RoomTile;
|
||||||
|
return <RoomTileComponent
|
||||||
index={index} // For DND
|
index={index} // For DND
|
||||||
room={ room }
|
room={room}
|
||||||
roomSubList={ self }
|
roomSubList={this}
|
||||||
tagName={self.props.tagName}
|
tagName={this.props.tagName}
|
||||||
key={ room.roomId }
|
key={room.roomId}
|
||||||
collapsed={ self.props.collapsed || false}
|
collapsed={this.props.collapsed || false}
|
||||||
unread={ Unread.doesRoomHaveUnreadMessages(room) }
|
unread={Unread.doesRoomHaveUnreadMessages(room)}
|
||||||
highlight={ room.getUnreadNotificationCount('highlight') > 0 || self.props.isInvite }
|
highlight={room.getUnreadNotificationCount('highlight') > 0 || this.props.isInvite}
|
||||||
isInvite={ self.props.isInvite }
|
isInvite={this.props.isInvite}
|
||||||
refreshSubList={ self._updateSubListCount }
|
refreshSubList={this._updateSubListCount}
|
||||||
incomingCall={ null }
|
incomingCall={null}
|
||||||
onClick={ self.onRoomTileClick }
|
onClick={this.onRoomTileClick}
|
||||||
/>
|
/>;
|
||||||
);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue