Update scope to use Unconfined (#421)

This commit is contained in:
Brian Yencho 2023-12-20 10:06:18 -06:00 committed by Álison Fernandes
parent 6f85a6eb75
commit 21f51c90ad

View file

@ -23,7 +23,7 @@ class NetworkConfigManagerImpl(
dispatcherManager: DispatcherManager,
) : NetworkConfigManager {
private val scope = CoroutineScope(dispatcherManager.io)
private val collectionScope = CoroutineScope(dispatcherManager.unconfined)
init {
authRepository
@ -35,14 +35,14 @@ class NetworkConfigManagerImpl(
is AuthState.Uninitialized -> null
}
}
.launchIn(scope)
.launchIn(collectionScope)
environmentRepository
.environmentStateFlow
.onEach { environment ->
baseUrlInterceptors.environment = environment
}
.launchIn(scope)
.launchIn(collectionScope)
refreshAuthenticator.authenticatorProvider = authRepository
}