Fix tags tests
This commit is contained in:
@@ -146,12 +146,14 @@ class Repository(private val api: SelfossApi, private val appSettingsService: Ap
|
||||
suspend fun getTags(): List<SelfossModel.Tag> {
|
||||
return if (isNetworkAvailable()) {
|
||||
val apiTags = api.tags()
|
||||
if (apiTags.success && apiTags.data != null && (appSettingsService.isItemCachingEnabled() || !appSettingsService.isUpdateSourcesEnabled())) {
|
||||
if (apiTags.success && apiTags.data != null && (appSettingsService.isItemCachingEnabled() || appSettingsService.isUpdateSourcesEnabled())) {
|
||||
resetDBTagsWithData(apiTags.data)
|
||||
}
|
||||
apiTags.data ?: emptyList()
|
||||
} else {
|
||||
} else if (appSettingsService.isItemCachingEnabled() || appSettingsService.isUpdateSourcesEnabled()) {
|
||||
getDBTags().map { it.toView() }
|
||||
} else {
|
||||
emptyList()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user