fix: revert change to how unread notification count is calculated (#1671)

This commit is contained in:
ggurdin 2025-01-31 14:14:10 -05:00 committed by GitHub
parent d5dd66bcc2
commit 78e7c9f7d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,