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
merge-requests/67/merge
Hank Grabowski 2024-06-28 13:28:36 -04:00
rodzic 2d27918244
commit 691a0e5d90
1 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

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