chat-fe: filter empty groups in sidebar

Empty groups caused the padding on the first group to be too large.
Filter the groups before we map over them so that we can set padding
properly.

Fixes #2674
This commit is contained in:
Liam Fitzgerald 2020-04-09 15:04:34 +10:00
parent c570def06a
commit 6586aa98e3

View File

@ -58,6 +58,7 @@ export class Sidebar extends Component {
});
let groupedItems = Object.keys(associations)
.filter((each) => (groupedChannels[each] || []).length !== 0)
.filter((each) => {
if (selectedGroups.length === 0) {
return true;
@ -67,7 +68,6 @@ export class Sidebar extends Component {
})
.map((each, i) => {
let channels = groupedChannels[each] || [];
if (channels.length === 0) return;
return(
<GroupItem
key={i}