diff options
Diffstat (limited to 'src/utils/messages.ts')
-rw-r--r-- | src/utils/messages.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/utils/messages.ts b/src/utils/messages.ts index a0bbdb46..49033226 100644 --- a/src/utils/messages.ts +++ b/src/utils/messages.ts @@ -92,7 +92,7 @@ export const connectChatAccount = async ( try { await getChatToken(); const chatToken = await AsyncStorage.getItem('chatToken'); - if (chatToken) { + if (!chatClient.user && chatToken) { await chatClient.connectUser( { id: loggedInUserId, @@ -100,6 +100,8 @@ export const connectChatAccount = async ( chatToken, ); return true; + } else if (chatClient.user) { + return true; } else { console.log('Unable to connect to stream. Empty chat token'); return false; |