From 9fccb2c81f4ccd4bf2891929c8e91d167827548c Mon Sep 17 00:00:00 2001
From: Ivan Chen <ivan@tagg.id>
Date: Thu, 22 Apr 2021 19:29:47 -0400
Subject: changed method

---
 src/components/messages/ChannelPreview.tsx | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'src/components/messages/ChannelPreview.tsx')

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}
-- 
cgit v1.2.3-70-g09d2

