fix for markAllRead()

This commit is contained in:
Deven Joshi
2021-10-08 17:28:29 +05:30
parent 334d28c263
commit fb6e1e8977
@@ -1376,6 +1376,8 @@ class ClientState {
_listenChannelHidden();
_listenUserUpdated();
_listenAllChannelsRead();
}
final _subscriptions = <StreamSubscription>[];
@@ -1405,6 +1407,18 @@ class ClientState {
}));
}
void _listenAllChannelsRead() {
_subscriptions
.add(_client.on(EventType.notificationMarkRead).listen((event) {
if (event.cid == null) {
channels
.forEach((key, value) {
value.state?.unreadCount = 0;
});
}
}));
}
void _listenChannelDeleted() {
_subscriptions.add(_client
.on(