diff options
author | Shravya Ramesh <shravs1208@gmail.com> | 2021-04-09 15:48:50 -0700 |
---|---|---|
committer | Shravya Ramesh <shravs1208@gmail.com> | 2021-04-09 15:48:50 -0700 |
commit | 5e9c0bcff40f0fa743f1c579c1ed135b3e1833b6 (patch) | |
tree | 272a85117ec513a9e60c671b420e362e48a04204 /src | |
parent | d595c4354b0a0a6892844457f3713538c75367b0 (diff) |
fix
Diffstat (limited to 'src')
-rw-r--r-- | src/components/profile/ProfileBody.tsx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/components/profile/ProfileBody.tsx b/src/components/profile/ProfileBody.tsx index eebdb167..00532507 100644 --- a/src/components/profile/ProfileBody.tsx +++ b/src/components/profile/ProfileBody.tsx @@ -97,19 +97,19 @@ const ProfileBody: React.FC<ProfileBodyProps> = ({ }; const onPressMessage = async () => { - let connected: boolean = !chatClient.user; - if (!connected) { - connected = await connectChatAccount(loggedInUserId, chatClient); - if (!connected) { - Alert.alert('Unable to connect chat'); - } - } else { + let connected: boolean = await connectChatAccount( + loggedInUserId, + chatClient, + ); + if (connected) { const channel = chatClient.channel('messaging', { members: [loggedInUserId, String(userXId)], }); channel.create(); setChannel(channel); navigation.navigate('Chat'); + } else { + Alert.alert('Something wrong with chat'); } }; |