@@ -8,12 +8,12 @@ import com.artemchep.keyguard.common.usecase.PutScreenState
8
8
import com.artemchep.keyguard.common.usecase.ShowMessage
9
9
import com.artemchep.keyguard.common.usecase.WindowCoroutineScope
10
10
import com.artemchep.keyguard.common.usecase.impl.WindowCoroutineScopeImpl
11
+ import com.artemchep.keyguard.common.util.job
11
12
import com.artemchep.keyguard.feature.navigation.NavigationController
12
13
import com.artemchep.keyguard.feature.navigation.NavigationEntry
13
14
import com.artemchep.keyguard.platform.LeBundle
14
15
import com.artemchep.keyguard.platform.LeContext
15
16
import com.artemchep.keyguard.platform.leBundleOf
16
- import kotlinx.coroutines.Dispatchers
17
17
import kotlinx.coroutines.Job
18
18
import kotlinx.coroutines.SupervisorJob
19
19
import kotlinx.coroutines.plus
@@ -49,9 +49,9 @@ class FlowHolderViewModel(
49
49
init : RememberStateFlowScopeZygote .() -> T ,
50
50
): T = synchronized(this ) {
51
51
store.getOrPut(key) {
52
- val vmCoroutineScopeJob = SupervisorJob ()
52
+ val vmCoroutineScopeJob = SupervisorJob (parent = scope.job )
53
53
val vmCoroutineScope = WindowCoroutineScopeImpl (
54
- scope = scope + vmCoroutineScopeJob + Dispatchers . Default ,
54
+ scope = scope + vmCoroutineScopeJob,
55
55
showMessage = showMessage,
56
56
)
57
57
val vmScope = RememberStateFlowScopeImpl (
@@ -87,18 +87,9 @@ class FlowHolderViewModel(
87
87
}
88
88
}
89
89
90
- private var isDestroyed = false
91
-
92
90
fun destroy () {
93
- synchronized(this ) {
94
- if (! isDestroyed) {
95
- isDestroyed = true
96
- //
97
- store.keys.toSet().forEach {
98
- clear(it)
99
- }
100
- }
101
- }
91
+ // Do nothing. We do not want to clear all of the screens
92
+ // because there still might be a screen exit animation running.
102
93
}
103
94
104
95
fun persistedState (): LeBundle {
0 commit comments