Hide room list show less button if it would do nothing

Signed-off-by:  Tim <tim@wants.coffee>

On the new rooms list, if the show less button wouldn't result in a
smaller list, don't show it.

Fixes vector-im/riot-web#14219
This commit is contained in:
☕ Tim 2020-06-28 04:08:06 +08:00
parent 5172c7b205
commit c8381021b8

View File

@ -393,7 +393,7 @@ export default class RoomSublist2 extends React.Component<IProps, IState> {
{showMoreText} {showMoreText}
</div> </div>
); );
} else if (tiles.length <= nVisible && tiles.length > this.props.layout.minVisibleTiles) { } else if (tiles.length <= nVisible && tiles.length > this.props.layout.defaultVisibleTiles) {
// we have all tiles visible - add a button to show less // we have all tiles visible - add a button to show less
let showLessText = ( let showLessText = (
<span className='mx_RoomSublist2_showNButtonText'> <span className='mx_RoomSublist2_showNButtonText'>