mirror of
https://github.com/bitwarden/android.git
synced 2024-11-24 18:36:32 +03:00
[PM-14346] Run alias generation on the IO dispatcher (#4215)
This commit is contained in:
parent
3e5e6ce3ab
commit
8f2d55c146
1 changed files with 3 additions and 1 deletions
|
@ -38,6 +38,7 @@ import kotlinx.coroutines.flow.onEach
|
||||||
import kotlinx.coroutines.flow.onStart
|
import kotlinx.coroutines.flow.onStart
|
||||||
import kotlinx.coroutines.flow.receiveAsFlow
|
import kotlinx.coroutines.flow.receiveAsFlow
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
import kotlinx.coroutines.withContext
|
||||||
import java.time.Clock
|
import java.time.Clock
|
||||||
import javax.inject.Singleton
|
import javax.inject.Singleton
|
||||||
|
|
||||||
|
@ -190,7 +191,7 @@ class GeneratorRepositoryImpl(
|
||||||
|
|
||||||
override suspend fun generateForwardedServiceUsername(
|
override suspend fun generateForwardedServiceUsername(
|
||||||
forwardedServiceGeneratorRequest: UsernameGeneratorRequest.Forwarded,
|
forwardedServiceGeneratorRequest: UsernameGeneratorRequest.Forwarded,
|
||||||
): GeneratedForwardedServiceUsernameResult =
|
): GeneratedForwardedServiceUsernameResult = withContext(scope.coroutineContext) {
|
||||||
generatorSdkSource.generateForwardedServiceEmail(forwardedServiceGeneratorRequest)
|
generatorSdkSource.generateForwardedServiceEmail(forwardedServiceGeneratorRequest)
|
||||||
.fold(
|
.fold(
|
||||||
onSuccess = { generatedEmail ->
|
onSuccess = { generatedEmail ->
|
||||||
|
@ -200,6 +201,7 @@ class GeneratorRepositoryImpl(
|
||||||
GeneratedForwardedServiceUsernameResult.InvalidRequest(it.message)
|
GeneratedForwardedServiceUsernameResult.InvalidRequest(it.message)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
override fun getPasscodeGenerationOptions(): PasscodeGenerationOptions? {
|
override fun getPasscodeGenerationOptions(): PasscodeGenerationOptions? {
|
||||||
val userId = authDiskSource.userState?.activeUserId
|
val userId = authDiskSource.userState?.activeUserId
|
||||||
|
|
Loading…
Reference in a new issue