fix: Unread and starred can be null.
This commit is contained in:
parent
1f3fa0c4a6
commit
d9d057c8dc
@ -24,8 +24,8 @@ class SelfossModel {
|
||||
@Serializable
|
||||
class Stats(
|
||||
val total: Int,
|
||||
val unread: Int,
|
||||
val starred: Int
|
||||
val unread: Int?,
|
||||
val starred: Int?
|
||||
)
|
||||
|
||||
@Serializable
|
||||
|
@ -132,9 +132,9 @@ class Repository(
|
||||
if (isNetworkAvailable()) {
|
||||
val response = api.stats()
|
||||
if (response.success && response.data != null) {
|
||||
_badgeUnread.value = response.data.unread
|
||||
_badgeUnread.value = response.data.unread ?: 0
|
||||
_badgeAll.value = response.data.total
|
||||
_badgeStarred.value = response.data.starred
|
||||
_badgeStarred.value = response.data.starred ?: 0
|
||||
success = true
|
||||
}
|
||||
} else if (appSettingsService.isItemCachingEnabled()) {
|
||||
|
Loading…
Reference in New Issue
Block a user