diff options
| author | Ivan Chen <ivan@tagg.id> | 2021-04-13 18:27:07 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-13 18:27:07 -0400 |
| commit | 93837e23a169e6b17432e4e0dd397bcaa140bb5e (patch) | |
| tree | cc5694a2684c7faeda360a7b239d976a4c60edbb /src/screens | |
| parent | 1c7690a3b398e12834aa2aaa0b7c34c9e9a65821 (diff) | |
| parent | d074b671293c8038935674ebfb990e844128cf07 (diff) | |
Merge pull request #364 from shravyaramesh/chat-token-issue
[Bugfix] Stale chat token replaced
Diffstat (limited to 'src/screens')
| -rw-r--r-- | src/screens/chat/ChatListScreen.tsx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/screens/chat/ChatListScreen.tsx b/src/screens/chat/ChatListScreen.tsx index 0cbc7592..d2cfcb5d 100644 --- a/src/screens/chat/ChatListScreen.tsx +++ b/src/screens/chat/ChatListScreen.tsx @@ -56,17 +56,19 @@ const ChatListScreen: React.FC<ChatListScreenProps> = () => { }; useEffect(() => { - connectChatAccount(loggedInUserId, chatClient) - .then((success) => { - if (!success) { + if (loggedInUserId) { + 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'); - } - }) - .catch((err) => { - console.log('Error connecting to chat: ', err); - Alert.alert('Something wrong with chat'); - }); - }, []); + }); + } + }, [loggedInUserId]); return ( <View style={styles.background}> |
