fix: notification incrementing

This commit is contained in:
rebelonion
2024-04-04 01:15:18 -05:00
parent 93172153b7
commit 79113cb04a

View File

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