From 366e77ceb76cfd7dda066874900214969fa6f3f6 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Wed, 16 Jun 2021 10:48:19 +0200 Subject: [PATCH] fix reconnection logic --- .../stream_chat_flutter_core/lib/src/stream_chat_core.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/stream_chat_flutter_core/lib/src/stream_chat_core.dart b/packages/stream_chat_flutter_core/lib/src/stream_chat_core.dart index aa23a959..e80472cd 100644 --- a/packages/stream_chat_flutter_core/lib/src/stream_chat_core.dart +++ b/packages/stream_chat_flutter_core/lib/src/stream_chat_core.dart @@ -125,7 +125,8 @@ class StreamChatCoreState extends State _isConnectionAvailable = result != ConnectivityResult.none; if (!_isInForeground) return; if (_isConnectionAvailable) { - if (client.wsConnectionStatus == ConnectionStatus.disconnected) { + if (client.wsConnectionStatus == ConnectionStatus.disconnected && + user != null) { client.openConnection(); } } else {