Skip to content

Commit

Permalink
fix reconnection logic
Browse files Browse the repository at this point in the history
  • Loading branch information
imtoori committed Jun 16, 2021
1 parent dfacff0 commit 2af7c78
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ class StreamChatCoreState extends State<StreamChatCore>
_isConnectionAvailable = result != ConnectivityResult.none;
if (!_isInForeground) return;
if (_isConnectionAvailable) {
if (client.wsConnectionStatus == ConnectionStatus.disconnected) {
if (client.wsConnectionStatus == ConnectionStatus.disconnected &&
user != null) {
client.connect();
}
} else {
Expand Down

0 comments on commit 2af7c78

Please sign in to comment.