aboutsummaryrefslogtreecommitdiff
path: root/src/components/messages/ChannelPreview.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-04-23 16:02:00 -0400
committerGitHub <noreply@github.com>2021-04-23 16:02:00 -0400
commit0b18b88f2b1e141a8b8372b08c0ce8e7eaecbc1c (patch)
tree79f1522cc59a3a0ab370de603c97a884266c5212 /src/components/messages/ChannelPreview.tsx
parent5cd8f84acb629c9fee0fd43c3f0c1fd23c109319 (diff)
parent9fccb2c81f4ccd4bf2891929c8e91d167827548c (diff)
Merge pull request #382 from IvanIFChen/tma817-hide-empty-chats
[TMA-817] Hide empty chats
Diffstat (limited to 'src/components/messages/ChannelPreview.tsx')
-rw-r--r--src/components/messages/ChannelPreview.tsx5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/components/messages/ChannelPreview.tsx b/src/components/messages/ChannelPreview.tsx
index 8bd3a745..4c3eb9d8 100644
--- a/src/components/messages/ChannelPreview.tsx
+++ b/src/components/messages/ChannelPreview.tsx
@@ -37,6 +37,11 @@ const ChannelPreview: React.FC<
const online = isOnline(member?.user?.last_active);
const unread = channel.state.unreadCount > 0;
+ // Hide channel if no message was exchanged
+ if (channel.state.messages.length === 0) {
+ return null;
+ }
+
return (
<TouchableOpacity
style={styles.container}