Fix loading state

This commit is contained in:
Koitharu
2023-07-11 11:34:47 +03:00
parent 2aeefc607b
commit ab2a6f5a17
2 changed files with 2 additions and 3 deletions

View File

@@ -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,

View File

@@ -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"