From 61034f314712750225ba21f1763014f26953479a Mon Sep 17 00:00:00 2001 From: Shravya Ramesh Date: Fri, 9 Apr 2021 16:16:36 -0700 Subject: remove redundant if --- src/screens/chat/ChatListScreen.tsx | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/screens/chat/ChatListScreen.tsx b/src/screens/chat/ChatListScreen.tsx index a019891a..f9db0c77 100644 --- a/src/screens/chat/ChatListScreen.tsx +++ b/src/screens/chat/ChatListScreen.tsx @@ -45,19 +45,16 @@ const ChatListScreen: React.FC = () => { ); useEffect(() => { - let connected: boolean = !chatClient.user; - if (!connected) { - connectChatAccount(loggedInUserId, chatClient) - .then((success) => { - if (!success) { - Alert.alert('Something wrong with chat'); - } - }) - .catch((err) => { - console.log('Error connecting to chat: ', err); + connectChatAccount(loggedInUserId, chatClient) + .then((success) => { + if (!success) { Alert.alert('Something wrong with chat'); - }); - } + } + }) + .catch((err) => { + console.log('Error connecting to chat: ', err); + Alert.alert('Something wrong with chat'); + }); }, []); return ( -- cgit v1.2.3-70-g09d2