Throttle notification cancellation

pull/1212/head
Alex Baker 5 years ago
parent 9ab469ea17
commit e7f61f4050

@ -56,8 +56,10 @@ class NotificationManager @Inject constructor(
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
suspend fun cancel(ids: Iterable<Long>) { suspend fun cancel(ids: Iterable<Long>) {
for (id in ids) { for (id in ids) {
notificationManagerCompat.cancel(id.toInt()) throttle.run {
queue.remove(id) notificationManagerCompat.cancel(id.toInt())
queue.remove(id)
}
} }
notificationDao.deleteAll(ids.toList()) notificationDao.deleteAll(ids.toList())
notifyTasks(emptyList(), alert = false, nonstop = false, fiveTimes = false) notifyTasks(emptyList(), alert = false, nonstop = false, fiveTimes = false)

Loading…
Cancel
Save