aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShravya Ramesh <shravs1208@gmail.com>2021-04-09 16:16:36 -0700
committerShravya Ramesh <shravs1208@gmail.com>2021-04-09 16:16:36 -0700
commit61034f314712750225ba21f1763014f26953479a (patch)
tree789ba6f4e23199d2bf0c42b92bbc5cce5486b91e
parent5e9c0bcff40f0fa743f1c579c1ed135b3e1833b6 (diff)
remove redundant if
-rw-r--r--src/screens/chat/ChatListScreen.tsx21
1 files changed, 9 insertions, 12 deletions
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<ChatListScreenProps> = () => {
);
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 (