@@ -14,20 +14,15 @@ import io.github.sds100.keymapper.system.permissions.SystemFeatureAdapter
1414import io.github.sds100.keymapper.system.ringtones.RingtoneAdapter
1515import javax.inject.Inject
1616import javax.inject.Singleton
17- import kotlinx.coroutines.CoroutineScope
1817import kotlinx.coroutines.flow.Flow
19- import kotlinx.coroutines.flow.SharingStarted
20- import kotlinx.coroutines.flow.StateFlow
2118import kotlinx.coroutines.flow.channelFlow
2219import kotlinx.coroutines.flow.collectLatest
2320import kotlinx.coroutines.flow.drop
2421import kotlinx.coroutines.flow.map
2522import kotlinx.coroutines.flow.merge
26- import kotlinx.coroutines.flow.stateIn
2723
2824@Singleton
2925class GetActionErrorUseCaseImpl @Inject constructor(
30- private val coroutineScope : CoroutineScope ,
3126 private val packageManagerAdapter : PackageManagerAdapter ,
3227 private val inputMethodAdapter : InputMethodAdapter ,
3328 private val switchImeInterface : SwitchImeInterface ,
@@ -54,13 +49,13 @@ class GetActionErrorUseCaseImpl @Inject constructor(
5449 ),
5550 )
5651
57- override val actionErrorSnapshot: StateFlow <ActionErrorSnapshot > = channelFlow {
52+ override val actionErrorSnapshot: Flow <ActionErrorSnapshot > = channelFlow {
5853 send(createSnapshot())
5954
6055 invalidateActionErrors.collectLatest {
6156 send(createSnapshot())
6257 }
63- }.stateIn(coroutineScope, SharingStarted . Eagerly , createSnapshot())
58+ }
6459
6560 private fun createSnapshot (): ActionErrorSnapshot {
6661 return LazyActionErrorSnapshot (
0 commit comments