feat(ui): only handle the latest events in channelEventSubscription

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2022-03-23 16:25:51 +05:30
committed by xsahil03x
parent 2c2b6bdac2
commit 0a4eb0a171
@@ -220,8 +220,8 @@ class StreamChannelListController extends PagedValueNotifier<int, Channel> {
_unsubscribeFromChannelListEvents();
}
_channelEventSubscription = client.on().listen((event) {
print('event.type: ${event.type}');
_channelEventSubscription = client.on().skip(1) // skip the initial event
.listen((event) {
// Returns early if the event is already handled by the listener.
if (eventListener?.call(event) ?? false) return;