Fix empty chapters placeholder #176
This commit is contained in:
@@ -92,9 +92,12 @@ class DetailsViewModel(
|
|||||||
branches.indexOf(selected)
|
branches.indexOf(selected)
|
||||||
}.asLiveDataDistinct(viewModelScope.coroutineContext + Dispatchers.Default)
|
}.asLiveDataDistinct(viewModelScope.coroutineContext + Dispatchers.Default)
|
||||||
|
|
||||||
val isChaptersEmpty: LiveData<Boolean> = delegate.manga.map { m ->
|
val isChaptersEmpty: LiveData<Boolean> = combine(
|
||||||
m != null && m.chapters.isNullOrEmpty()
|
delegate.manga,
|
||||||
}.asLiveDataDistinct(viewModelScope.coroutineContext + Dispatchers.Default, false)
|
isLoading.asFlow(),
|
||||||
|
) { m, loading ->
|
||||||
|
m != null && m.chapters.isNullOrEmpty() && !loading
|
||||||
|
}.asLiveDataDistinct(viewModelScope.coroutineContext, false)
|
||||||
|
|
||||||
val chapters = combine(
|
val chapters = combine(
|
||||||
combine(
|
combine(
|
||||||
|
|||||||
Reference in New Issue
Block a user