From ebd3d3410606f3baf85034e23080783769fd9e4b Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 19 Oct 2018 18:35:27 +0200 Subject: [PATCH] make sure no resize handle is put after last sublist --- src/components/views/rooms/RoomList.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/views/rooms/RoomList.js b/src/components/views/rooms/RoomList.js index af9e952da6..c2baccc676 100644 --- a/src/components/views/rooms/RoomList.js +++ b/src/components/views/rooms/RoomList.js @@ -449,14 +449,15 @@ module.exports = React.createClass({ searchFilter: this.props.searchFilter, incomingCall: this.state.incomingCall, }; + + subListsProps = subListsProps.filter((props => { + const len = props.list.length + (props.extraTiles ? props.extraTiles.length : 0); + return len !== 0 || props.onAddRoom; + })); + return subListsProps.reduce((components, props, i) => { props = Object.assign({}, defaultProps, props); const isLast = i === subListsProps.length - 1; - const len = props.list.length + (props.extraTiles ? props.extraTiles.length : 0); - // empty and no add button? dont render - if (!len && !props.onAddRoom) { - return components; - } const {key, label, ... otherProps} = props; const chosenKey = key || label;