From 691a0e5d90cf90b6a7469bd1d53cc87d11affe0c Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Fri, 28 Jun 2024 13:28:36 -0400 Subject: [PATCH] Filter out DMs and CRs when determining if newer unread notifications before loading older read notifications since those always return regardless of minimum notfication ID Fixes Issue #101 --- lib/services/notifications_manager.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/services/notifications_manager.dart b/lib/services/notifications_manager.dart index f15d3fc..17a9e42 100644 --- a/lib/services/notifications_manager.dart +++ b/lib/services/notifications_manager.dart @@ -140,7 +140,13 @@ class NotificationsManager extends ChangeNotifier { if (unread.isNotEmpty) { final result = await _loadOlderUnreadNotifications(withListenerNotification); - if (result.getValueOrElse(() => []).isNotEmpty) { + final nonDmAndConnectionNotifications = result + .getValueOrElse(() => []) + .where((n) => + n.type != NotificationType.follow_request && + n.type != NotificationType.direct_message) + .toList(); + if (nonDmAndConnectionNotifications.isNotEmpty) { return result; } }