Implement getFilters() without rxjava (#2990)
This commit is contained in:
parent
25443217c2
commit
f796f77f9a
4 changed files with 10 additions and 14 deletions
|
|
@ -337,12 +337,11 @@ class ViewThreadViewModel @Inject constructor(
|
|||
|
||||
private fun loadFilters() {
|
||||
viewModelScope.launch {
|
||||
val filters = try {
|
||||
api.getFilters().await()
|
||||
} catch (t: Exception) {
|
||||
Log.w(TAG, "Failed to fetch filters", t)
|
||||
val filters = api.getFilters().getOrElse {
|
||||
Log.w(TAG, "Failed to fetch filters", it)
|
||||
return@launch
|
||||
}
|
||||
|
||||
filterModel.initWithFilters(
|
||||
filters.filter { filter ->
|
||||
filter.context.contains(Filter.THREAD)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue