fix reconnection event

This commit is contained in:
Salvatore Giordano
2022-03-22 16:34:06 +01:00
parent 1358a68ebb
commit 5f12802799
4 changed files with 25 additions and 14 deletions
@@ -417,6 +417,7 @@ class StreamChatClient {
}
void _connectionStatusHandler(ConnectionStatus status) async {
final previousState = wsConnectionStatus;
final currentState = _wsConnectionStatus = status;
handleEvent(Event(
@@ -436,10 +437,12 @@ class StreamChatClient {
await sync(cids: cids, lastSyncAt: _lastSyncedAt);
}
}
handleEvent(Event(
type: EventType.connectionRecovered,
online: true,
));
if (previousState != ConnectionStatus.connected) {
handleEvent(Event(
type: EventType.connectionRecovered,
online: true,
));
}
}
}