performance fixes

This commit is contained in:
Salvatore Giordano
2021-06-09 16:11:59 +02:00
parent e567e5f12b
commit dc6c3094e9
26 changed files with 1224 additions and 1158 deletions
@@ -1709,7 +1709,7 @@ class ChannelClientState {
final BehaviorSubject<int> _unreadCountController = BehaviorSubject.seeded(0);
/// Unread count getter as a stream
Stream<int> get unreadCountStream => _unreadCountController.stream;
Stream<int> get unreadCountStream => _unreadCountController.stream.distinct();
/// Unread count getter
int? get unreadCount => _unreadCountController.value;
+4 -2
View File
@@ -1532,13 +1532,15 @@ class ClientState {
int? get unreadChannels => _unreadChannelsController.valueOrNull;
/// The current unread channels count as a stream
Stream<int?> get unreadChannelsStream => _unreadChannelsController.stream;
Stream<int?> get unreadChannelsStream =>
_unreadChannelsController.stream.distinct();
/// The current total unread messages count
int? get totalUnreadCount => _totalUnreadCountController.valueOrNull;
/// The current total unread messages count as a stream
Stream<int?> get totalUnreadCountStream => _totalUnreadCountController.stream;
Stream<int?> get totalUnreadCountStream =>
_totalUnreadCountController.stream.distinct();
/// The current list of channels in memory as a stream
Stream<Map<String?, Channel>?> get channelsStream =>