From afb708df79a91eb661fae4301ece8773a2805e51 Mon Sep 17 00:00:00 2001 From: Roland Osborne Date: Fri, 13 May 2022 15:24:42 -0700 Subject: [PATCH] avoid rendering empty handles --- .../ChannelItem/ChannelLabel/ChannelLabel.jsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/net/web/src/User/SideBar/Contacts/Channels/ChannelItem/ChannelLabel/ChannelLabel.jsx b/net/web/src/User/SideBar/Contacts/Channels/ChannelItem/ChannelLabel/ChannelLabel.jsx index 994d30e4..10c88886 100644 --- a/net/web/src/User/SideBar/Contacts/Channels/ChannelItem/ChannelLabel/ChannelLabel.jsx +++ b/net/web/src/User/SideBar/Contacts/Channels/ChannelItem/ChannelLabel/ChannelLabel.jsx @@ -31,16 +31,14 @@ export function ChannelLabel({ item }) { if (item?.guid) { setHost(false); contacts.push(actions.getCardByGuid(item.guid)?.data?.cardProfile?.handle); - for (let member of item.data.channelDetail.members) { - if (member != state.guid) { - contacts.push(actions.getCardByGuid(member)?.data?.cardProfile?.handle); - } - } } else { setHost(true); - for (let member of item.data.channelDetail.members) { - contacts.push(actions.getCardByGuid(member)?.data?.cardProfile?.handle); + } + for (let member of item.data.channelDetail.members) { + let contact = actions.getCardByGuid(member)?.data?.cardProfile?.handle; + if (contact) { + contacts.push(contact); } }