diff --git a/app/views/RoomsListView/index.js b/app/views/RoomsListView/index.js index b531a00ea..4cdb2060c 100644 --- a/app/views/RoomsListView/index.js +++ b/app/views/RoomsListView/index.js @@ -502,7 +502,19 @@ export default class RoomsListView extends LoggedView { ); } - renderSeparator = () => ; + renderSeparator = () => + + renderSectionHeader = (header) => { + const { showUnread, showFavorites, groupByType } = this.props; + if (!(showUnread || showFavorites || groupByType)) { + return null; + } + return ( + + {I18n.t(header)} + + ); + } renderSection = (data, header) => { const { showUnread, showFavorites, groupByType } = this.props; @@ -525,11 +537,7 @@ export default class RoomsListView extends LoggedView { style={styles.list} renderItem={this.renderItem} ItemSeparatorComponent={this.renderSeparator} - ListHeaderComponent={() => ( - - {I18n.t(header)} - - )} + ListHeaderComponent={() => this.renderSectionHeader(header)} getItemLayout={getItemLayout} enableEmptySections removeClippedSubviews