fix: Init ViewModel on a default dispatchers pool

This commit is contained in:
Artem Chepurnoy 2024-02-28 13:53:02 +02:00
parent 2dc4740bc1
commit 13e2b7f360
No known key found for this signature in database
GPG Key ID: FAC37D0CF674043E

View File

@ -14,6 +14,7 @@ import com.artemchep.keyguard.feature.navigation.NavigationEntry
import com.artemchep.keyguard.platform.LeBundle import com.artemchep.keyguard.platform.LeBundle
import com.artemchep.keyguard.platform.LeContext import com.artemchep.keyguard.platform.LeContext
import com.artemchep.keyguard.platform.leBundleOf import com.artemchep.keyguard.platform.leBundleOf
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job import kotlinx.coroutines.Job
import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.plus import kotlinx.coroutines.plus
@ -51,7 +52,7 @@ class FlowHolderViewModel(
store.getOrPut(key) { store.getOrPut(key) {
val vmCoroutineScopeJob = SupervisorJob(parent = scope.job) val vmCoroutineScopeJob = SupervisorJob(parent = scope.job)
val vmCoroutineScope = WindowCoroutineScopeImpl( val vmCoroutineScope = WindowCoroutineScopeImpl(
scope = scope + vmCoroutineScopeJob, scope = scope + vmCoroutineScopeJob + Dispatchers.Default,
showMessage = showMessage, showMessage = showMessage,
) )
val vmScope = RememberStateFlowScopeImpl( val vmScope = RememberStateFlowScopeImpl(