From 1e2695db5107030d12fba9792028ee32e43de588 Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Sat, 16 Mar 2019 22:32:13 -0600 Subject: [PATCH] Improve error handling of RxJava operations in ReceiveTransactionsFragment. --- .../fragments/ReceiveTransactionFragment.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/ReceiveTransactionFragment.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/ReceiveTransactionFragment.kt index dc65723..e7311ef 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/ReceiveTransactionFragment.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/ReceiveTransactionFragment.kt @@ -173,8 +173,7 @@ class ReceiveTransactionFragment : ConnectedFragment() { tietAmount.textChanges() .debounce(1000, TimeUnit.MILLISECONDS) .observeOn(AndroidSchedulers.mainThread()) - .doOnError { mAsset = null } - .subscribe { updateQR() } + .subscribe( { updateQR() }, { mAsset = null} ) ) // Add adapter to the Assets AutoCompleteTextView @@ -189,8 +188,7 @@ class ReceiveTransactionFragment : ConnectedFragment() { .debounce(500, TimeUnit.MILLISECONDS) .map { it.toString().trim().toUpperCase() } .observeOn(AndroidSchedulers.mainThread()) - .doOnError { mAsset = null } - .subscribe { + .subscribe( { if (!selectedInAutoCompleteTextView) { mAsset = null updateQR() @@ -203,7 +201,7 @@ class ReceiveTransactionFragment : ConnectedFragment() { ListAssets.REQUIRED_API) if (id != null) responseMap.append(id, RESPONSE_LIST_ASSETS) } - } + }, { mAsset = null } ) ) actvAsset.setOnItemClickListener { parent, _, position, _ ->