Fix repository.tags() returning null

This commit is contained in:
2022-09-27 23:26:44 +02:00
parent 7517626ab7
commit cb4f2f02ef
2 changed files with 5 additions and 5 deletions

View File

@ -143,13 +143,13 @@ class Repository(private val api: SelfossApi, private val appSettingsService: Ap
return success
}
suspend fun getTags(): List<SelfossModel.Tag>? {
suspend fun getTags(): List<SelfossModel.Tag> {
return if (isNetworkAvailable()) {
val apiTags = api.tags()
if (apiTags.success && apiTags.data != null && (appSettingsService.isItemCachingEnabled() || !appSettingsService.isUpdateSourcesEnabled())) {
resetDBTagsWithData(apiTags.data)
}
apiTags.data
apiTags.data ?: emptyList()
} else {
getDBTags().map { it.toView() }
}