From 14cdd723f7855d074fa1e9adc24c85a1c088e97c Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 19 Oct 2018 14:33:51 +0200 Subject: [PATCH] only show chevron for non-empty lists --- src/components/structures/RoomSubList.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index d703a82664..6017ea64ee 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -265,12 +265,6 @@ const RoomSubList = React.createClass({ const subListNotifCount = subListNotifications[0]; const subListNotifHighlight = subListNotifications[1]; - const chevronClasses = classNames({ - 'mx_RoomSubList_chevron': true, - 'mx_RoomSubList_chevronRight': this.state.hidden, - 'mx_RoomSubList_chevronDown': !this.state.hidden, - }); - const badgeClasses = classNames({ 'mx_RoomSubList_badge': true, 'mx_RoomSubList_badgeHighlight': subListNotifHighlight, @@ -318,11 +312,21 @@ const RoomSubList = React.createClass({ } const tabindex = this.props.searchFilter === "" ? "0" : "-1"; + const len = this.state.sortedList.length + this.props.extraTiles.length; + let chevron; + if (len) { + const chevronClasses = classNames({ + 'mx_RoomSubList_chevron': true, + 'mx_RoomSubList_chevronRight': this.state.hidden, + 'mx_RoomSubList_chevronDown': !this.state.hidden, + }); + chevron = (
); + } return (
-
+ { chevron } { this.props.collapsed ? '' : this.props.label } { badge } { incomingCall }