From bb16e95e15f6ea9b8941cae764570bdf7c0fdb59 Mon Sep 17 00:00:00 2001
From: Ivan Chen <ivan@tagg.id>
Date: Thu, 8 Apr 2021 16:10:14 -0400
Subject: created util functions, updated isOnline

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

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

diff --git a/src/components/messages/ChannelPreview.tsx b/src/components/messages/ChannelPreview.tsx
index 11408dc1..867e0a38 100644
--- a/src/components/messages/ChannelPreview.tsx
+++ b/src/components/messages/ChannelPreview.tsx
@@ -16,6 +16,7 @@ import {
   LocalUserType,
 } from '../../types';
 import {normalize, SCREEN_HEIGHT} from '../../utils';
+import {isOnline} from '../../utils/messages';
 
 const ChannelPreview: React.FC<
   ChannelPreviewMessengerProps<
@@ -40,7 +41,7 @@ const ChannelPreview: React.FC<
       )
     : [];
   const member = otherMembers.length === 1 ? otherMembers[0] : undefined;
-  const online = member?.user?.online;
+  const online = isOnline(member?.user?.last_active);
   const unread = channel.state.unreadCount > 0;
 
   return (
-- 
cgit v1.2.3-70-g09d2

