Merge pull request #729 from GetStream/mark-read-fix
fix(llc): fix for markAllRead()
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
## Upcoming
|
||||
|
||||
🐞 Fixed
|
||||
|
||||
- markAllRead() now updates local channel states.
|
||||
|
||||
## 3.1.1
|
||||
|
||||
✅ Added
|
||||
|
||||
@@ -1376,6 +1376,8 @@ class ClientState {
|
||||
_listenChannelHidden();
|
||||
|
||||
_listenUserUpdated();
|
||||
|
||||
_listenAllChannelsRead();
|
||||
}
|
||||
|
||||
final _subscriptions = <StreamSubscription>[];
|
||||
@@ -1405,6 +1407,17 @@ 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(
|
||||
|
||||
Reference in New Issue
Block a user