Fix loading state

pull/413/head
Koitharu 3 years ago
parent 2aeefc607b
commit ab2a6f5a17
No known key found for this signature in database
GPG Key ID: 8E861F8CE6E7CE27

@ -34,7 +34,7 @@ abstract class BaseViewModel : ViewModel() {
val isLoading: StateFlow<Boolean>
get() = loadingCounter.map { it > 0 }
.stateIn(viewModelScope, SharingStarted.WhileSubscribed(5000), false)
.stateIn(viewModelScope, SharingStarted.WhileSubscribed(5000), loadingCounter.value > 0)
protected fun launchJob(
context: CoroutineContext = EmptyCoroutineContext,

@ -93,8 +93,7 @@
android:id="@+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true"
app:trackCornerRadius="@dimen/mtrl_progress_indicator_full_rounded_corner_radius" />
android:indeterminate="true" />
<TextView
android:id="@+id/textView_loading"

Loading…
Cancel
Save