From 5b58c1c23fa10db85c2bf9b946b5f7f8a2fafb5b Mon Sep 17 00:00:00 2001 From: Stefano Sansone Date: Wed, 1 May 2024 02:23:11 +0200 Subject: [PATCH] adjust stateflow starting mode --- .../app/omnivore/omnivore/feature/auth/LoginViewModel.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/android/Omnivore/app/src/main/java/app/omnivore/omnivore/feature/auth/LoginViewModel.kt b/android/Omnivore/app/src/main/java/app/omnivore/omnivore/feature/auth/LoginViewModel.kt index b8d6183cb..18fbf4703 100644 --- a/android/Omnivore/app/src/main/java/app/omnivore/omnivore/feature/auth/LoginViewModel.kt +++ b/android/Omnivore/app/src/main/java/app/omnivore/omnivore/feature/auth/LoginViewModel.kt @@ -5,10 +5,8 @@ import android.widget.Toast import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.setValue -import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel -import androidx.lifecycle.asLiveData import androidx.lifecycle.viewModelScope import app.omnivore.omnivore.BuildConfig import app.omnivore.omnivore.R @@ -45,7 +43,6 @@ import dagger.hilt.android.lifecycle.HiltViewModel import io.intercom.android.sdk.Intercom import kotlinx.coroutines.Job import kotlinx.coroutines.delay -import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.distinctUntilChanged @@ -101,7 +98,7 @@ class LoginViewModel @Inject constructor( followingTabActive ).stateIn( scope = viewModelScope, - started = SharingStarted.WhileSubscribed(), + started = SharingStarted.Lazily, initialValue = true )