Use a val for the StateFlow, and expose a StateFlow.

This commit is contained in:
Benoit Marty 2023-07-06 17:18:16 +02:00
parent f0910a4e2a
commit 072b59e06b
5 changed files with 9 additions and 14 deletions

View file

@ -20,7 +20,6 @@ import com.squareup.anvil.annotations.ContributesBinding
import io.element.android.features.login.api.LoginUserStory
import io.element.android.libraries.di.AppScope
import io.element.android.libraries.di.SingleIn
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import javax.inject.Inject
@ -28,9 +27,7 @@ import javax.inject.Inject
@ContributesBinding(AppScope::class)
class DefaultLoginUserStory @Inject constructor() : LoginUserStory {
// True by default, will be set to false when the login user story is started, and set to true again once it's done.
private val loginFlowIsDone: MutableStateFlow<Boolean> = MutableStateFlow(true)
override fun loginFlowIsDone(): Flow<Boolean> = loginFlowIsDone
override val loginFlowIsDone: MutableStateFlow<Boolean> = MutableStateFlow(true)
fun setLoginFlowIsDone(value: Boolean) {
loginFlowIsDone.value = value