aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/profile/ProfileBody.tsx14
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');
}
};