From 0a4eb0a1711ba3f5f71f98ac752776b4343a94c7 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Wed, 23 Mar 2022 16:25:51 +0530 Subject: [PATCH] feat(ui): only handle the latest events in channelEventSubscription Signed-off-by: xsahil03x --- .../lib/src/stream_channel_list_controller.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/stream_chat_flutter_core/lib/src/stream_channel_list_controller.dart b/packages/stream_chat_flutter_core/lib/src/stream_channel_list_controller.dart index 3b7342e5..7fa3b226 100644 --- a/packages/stream_chat_flutter_core/lib/src/stream_channel_list_controller.dart +++ b/packages/stream_chat_flutter_core/lib/src/stream_channel_list_controller.dart @@ -220,8 +220,8 @@ class StreamChannelListController extends PagedValueNotifier { _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;