Improve error handling of RxJava operations in ReceiveTransactionsFragment.
This commit is contained in:
parent
6fe13d9099
commit
1e2695db51
1 changed files with 3 additions and 5 deletions
|
@ -173,8 +173,7 @@ class ReceiveTransactionFragment : ConnectedFragment() {
|
||||||
tietAmount.textChanges()
|
tietAmount.textChanges()
|
||||||
.debounce(1000, TimeUnit.MILLISECONDS)
|
.debounce(1000, TimeUnit.MILLISECONDS)
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.doOnError { mAsset = null }
|
.subscribe( { updateQR() }, { mAsset = null} )
|
||||||
.subscribe { updateQR() }
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Add adapter to the Assets AutoCompleteTextView
|
// Add adapter to the Assets AutoCompleteTextView
|
||||||
|
@ -189,8 +188,7 @@ class ReceiveTransactionFragment : ConnectedFragment() {
|
||||||
.debounce(500, TimeUnit.MILLISECONDS)
|
.debounce(500, TimeUnit.MILLISECONDS)
|
||||||
.map { it.toString().trim().toUpperCase() }
|
.map { it.toString().trim().toUpperCase() }
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.doOnError { mAsset = null }
|
.subscribe( {
|
||||||
.subscribe {
|
|
||||||
if (!selectedInAutoCompleteTextView) {
|
if (!selectedInAutoCompleteTextView) {
|
||||||
mAsset = null
|
mAsset = null
|
||||||
updateQR()
|
updateQR()
|
||||||
|
@ -203,7 +201,7 @@ class ReceiveTransactionFragment : ConnectedFragment() {
|
||||||
ListAssets.REQUIRED_API)
|
ListAssets.REQUIRED_API)
|
||||||
if (id != null) responseMap.append(id, RESPONSE_LIST_ASSETS)
|
if (id != null) responseMap.append(id, RESPONSE_LIST_ASSETS)
|
||||||
}
|
}
|
||||||
}
|
}, { mAsset = null } )
|
||||||
)
|
)
|
||||||
|
|
||||||
actvAsset.setOnItemClickListener { parent, _, position, _ ->
|
actvAsset.setOnItemClickListener { parent, _, position, _ ->
|
||||||
|
|
Loading…
Reference in a new issue