From 4b0e55cd751bd77e05b8158177a74bd190974218 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Tue, 6 Apr 2021 15:35:22 -0400 Subject: added check for client ready --- src/screens/chat/ChatListScreen.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/screens/chat/ChatListScreen.tsx b/src/screens/chat/ChatListScreen.tsx index 0d180b98..801a9d19 100644 --- a/src/screens/chat/ChatListScreen.tsx +++ b/src/screens/chat/ChatListScreen.tsx @@ -45,10 +45,11 @@ const ChatListScreen: React.FC = ({navigation}) => { ); return setClientReady(true); }; - - setupClient().catch((err) => { - console.error(err); - }); + if (!clientReady) { + setupClient().catch((err) => { + console.error(err); + }); + } }, []); return ( -- cgit v1.2.3-70-g09d2