From 69da93487733256ed0d0a84a8887ef61ca43d350 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Wed, 20 May 2020 09:50:08 +0200 Subject: [PATCH] liste for notificationRemovedFromChannel --- lib/src/channels_bloc.dart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/src/channels_bloc.dart b/lib/src/channels_bloc.dart index a58759ab..d21d7cea 100644 --- a/lib/src/channels_bloc.dart +++ b/lib/src/channels_bloc.dart @@ -140,6 +140,13 @@ class ChannelsBlocState extends State await channel.watch(); _channelsController.add(List.from(channels..insert(0, channel))); })); + + _subscriptions.add( + client.on(EventType.notificationRemovedFromChannel).listen((e) async { + final channelModel = e.channel; + _channelsController.add( + List.from(channels..removeWhere((c) => c.cid == channelModel.cid))); + })); } @override