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