Fix badges tests

This commit is contained in:
2022-09-28 09:43:28 +02:00
parent 6cb4b35c93
commit 2968aee309
2 changed files with 9 additions and 17 deletions

View File

@@ -132,12 +132,13 @@ class Repository(private val api: SelfossApi, private val appSettingsService: Ap
badgeStarred = response.data.starred
success = true
}
} else {
} else if (appSettingsService.isItemCachingEnabled()) {
// TODO: do this differently, because it's not efficient
val dbItems = getDBItems()
badgeUnread = dbItems.filter { item -> item.unread }.size
badgeStarred = dbItems.filter { item -> item.starred }.size
badgeAll = items.size
badgeAll = dbItems.size
success = true
}
return success
}