fix: revert change to how unread notification count is calculated (#1671)
This commit is contained in:
parent
d5dd66bcc2
commit
78e7c9f7d9
1 changed files with 9 additions and 16 deletions
|
|
@ -22,22 +22,15 @@ class UnreadRoomsBadge extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
|
||||
// #Pangea
|
||||
// final unreadCount = Matrix.of(context)
|
||||
// .client
|
||||
// .rooms
|
||||
// .where(filter)
|
||||
// .where((r) => (r.isUnread || r.membership == Membership.invite))
|
||||
// .length;
|
||||
final unreadCounts =
|
||||
Matrix.of(context).client.rooms.where(filter).where((r) {
|
||||
if (r.isAnalyticsRoom) return false;
|
||||
return r.isUnread || r.membership == Membership.invite;
|
||||
}).map((r) => r.notificationCount);
|
||||
final unreadCount =
|
||||
unreadCounts.isEmpty ? 0 : unreadCounts.reduce((a, b) => a + b);
|
||||
|
||||
// Pangea#
|
||||
final unreadCount = Matrix.of(context)
|
||||
.client
|
||||
.rooms
|
||||
// #Pangea
|
||||
.where((r) => !r.isAnalyticsRoom)
|
||||
// Pangea#
|
||||
.where(filter)
|
||||
.where((r) => (r.isUnread || r.membership == Membership.invite))
|
||||
.length;
|
||||
return b.Badge(
|
||||
badgeStyle: b.BadgeStyle(
|
||||
badgeColor: theme.colorScheme.primary,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue