diff options
author | Shravya Ramesh <shravs1208@gmail.com> | 2021-04-09 13:46:42 -0700 |
---|---|---|
committer | Shravya Ramesh <shravs1208@gmail.com> | 2021-04-09 13:46:42 -0700 |
commit | bdd1ed17600da7b766e2b0fa97ad4cbf01234819 (patch) | |
tree | d4b8097cbea9ec7697967a62f2bf0be8ab30cc0a /src/components/profile/ProfileBody.tsx | |
parent | 55a5fa01be46a193d3917e1a334f300593a8ec01 (diff) |
removed client ready from redux
Diffstat (limited to 'src/components/profile/ProfileBody.tsx')
-rw-r--r-- | src/components/profile/ProfileBody.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/profile/ProfileBody.tsx b/src/components/profile/ProfileBody.tsx index dc68446b..e23249fa 100644 --- a/src/components/profile/ProfileBody.tsx +++ b/src/components/profile/ProfileBody.tsx @@ -63,7 +63,6 @@ const ProfileBody: React.FC<ProfileBodyProps> = ({ profile, ); - const {chatClientReady} = useSelector((state: RootState) => state.user); const {chatClient, setChannel} = useContext(ChatContext); const state: RootState = useStore().getState(); @@ -97,8 +96,9 @@ const ProfileBody: React.FC<ProfileBodyProps> = ({ }; const onPressMessage = async () => { - if (!chatClientReady) { - Alert.alert('Something wrong with chat'); + if (!chatClient.user) { + // TODO: Add refresh control to retry establishing chat connection + Alert.alert('Unable to connect chat'); } const channel = chatClient.channel('messaging', { members: [loggedInUserId, String(userXId)], |