diff options
author | Ivan Chen <ivan@tagg.id> | 2021-04-06 15:35:22 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-04-06 15:35:22 -0400 |
commit | 4b0e55cd751bd77e05b8158177a74bd190974218 (patch) | |
tree | e461f98ef710b7fe1b3508fd651684cbd147e293 | |
parent | 28218a67a6630863d57f1699e8453155ee5f2aa3 (diff) |
added check for client ready
-rw-r--r-- | src/screens/chat/ChatListScreen.tsx | 9 |
1 files changed, 5 insertions, 4 deletions
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<ChatListScreenProps> = ({navigation}) => { ); return setClientReady(true); }; - - setupClient().catch((err) => { - console.error(err); - }); + if (!clientReady) { + setupClient().catch((err) => { + console.error(err); + }); + } }, []); return ( |