fix for markAllRead()
This commit is contained in:
@@ -1376,6 +1376,8 @@ class ClientState {
|
|||||||
_listenChannelHidden();
|
_listenChannelHidden();
|
||||||
|
|
||||||
_listenUserUpdated();
|
_listenUserUpdated();
|
||||||
|
|
||||||
|
_listenAllChannelsRead();
|
||||||
}
|
}
|
||||||
|
|
||||||
final _subscriptions = <StreamSubscription>[];
|
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() {
|
void _listenChannelDeleted() {
|
||||||
_subscriptions.add(_client
|
_subscriptions.add(_client
|
||||||
.on(
|
.on(
|
||||||
|
|||||||
Reference in New Issue
Block a user