mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-11 17:36:16 +00:00
fix: notification incrementing
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user