From 79113cb04a02f286e63d82c6735f31ea8d821d69 Mon Sep 17 00:00:00 2001 From: rebelonion <87634197+rebelonion@users.noreply.github.com> Date: Thu, 4 Apr 2024 01:15:18 -0500 Subject: [PATCH] fix: notification incrementing --- .../notifications/comment/CommentNotificationTask.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/ani/dantotsu/notifications/comment/CommentNotificationTask.kt b/app/src/main/java/ani/dantotsu/notifications/comment/CommentNotificationTask.kt index b8cf6f7f..f6839558 100644 --- a/app/src/main/java/ani/dantotsu/notifications/comment/CommentNotificationTask.kt +++ b/app/src/main/java/ani/dantotsu/notifications/comment/CommentNotificationTask.kt @@ -46,11 +46,11 @@ class CommentNotificationTask : Task { ) notifications = - notifications?.filter { it.type != 3 || it.notificationId > recentGlobal } + notifications?.filter { !it.type.isGlobal() || it.notificationId > recentGlobal } ?.toMutableList() val newRecentGlobal = - notifications?.filter { it.type == 3 }?.maxOfOrNull { it.notificationId } + notifications?.filter { it.type.isGlobal() }?.maxOfOrNull { it.notificationId } if (newRecentGlobal != null) { PrefManager.setVal(PrefName.RecentGlobalNotification, newRecentGlobal) } @@ -313,4 +313,6 @@ class CommentNotificationTask : Task { null } } + + private fun Int?.isGlobal() = this == 3 || this == 420 } \ No newline at end of file