File tree Expand file tree Collapse file tree
app/src/main/java/cash/p/terminal/modules/send/address Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import kotlinx.coroutines.Dispatchers
1919import kotlinx.coroutines.Job
2020import kotlinx.coroutines.ensureActive
2121import kotlinx.coroutines.launch
22+ import kotlinx.coroutines.withContext
2223
2324class EnterAddressViewModel (
2425 private val token : Token ,
@@ -90,12 +91,14 @@ class EnterAddressViewModel(
9091 }
9192
9293 private fun processAddress (addressText : String ) {
93- parseAddressJob = viewModelScope.launch( Dispatchers . Default ) {
94+ parseAddressJob = viewModelScope.launch {
9495 try {
9596 val address = parseDomain(addressText)
9697 try {
97- addressValidator.validate(address)
98- ensureActive()
98+ withContext(Dispatchers .IO ) {
99+ addressValidator.validate(address)
100+ ensureActive()
101+ }
99102
100103 this @EnterAddressViewModel.address = address
101104 addressValidationInProgress = false
You can’t perform that action at this time.
0 commit comments