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
This commit is contained in:
Hank Grabowski 2024-06-28 13:28:36 -04:00
parent 2d27918244
commit 691a0e5d90

View file

@ -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;
}
}