Skip to content

Commit

Permalink
feat(ui): only handle the latest events in channelEventSubscription
Browse files Browse the repository at this point in the history
Signed-off-by: xsahil03x <[email protected]>
  • Loading branch information
xsahil03x committed Mar 23, 2022
1 parent 2c2b6bd commit 0a4eb0a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 0a4eb0a

Please sign in to comment.