Avoid three crashlytics reported crashes due to unhandled errors in RxJava operations in the ImportBrainkeyFragment.

This commit is contained in:
Severiano Jaramillo 2019-03-17 09:38:36 -06:00
parent 6f806db127
commit 143b6a011d

View file

@ -91,7 +91,10 @@ class ImportBrainkeyFragment : BaseAccountFragment() {
.skipInitialValue()
.debounce(500, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
.subscribe { validatePIN() }
.subscribe(
{ validatePIN() },
{ Crashlytics.log(Log.DEBUG, TAG, it.message) }
)
)
// Use RxJava Debounce to update the PIN Confirmation error only after the user stops writing for > 500 ms
@ -100,7 +103,10 @@ class ImportBrainkeyFragment : BaseAccountFragment() {
.skipInitialValue()
.debounce(500, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
.subscribe { validatePINConfirmation() }
.subscribe(
{ validatePINConfirmation() },
{ Crashlytics.log(Log.DEBUG, TAG, it.message) }
)
)
// Use RxJava Debounce to update the BrainKey error only after the user stops writing for > 500 ms
@ -110,7 +116,10 @@ class ImportBrainkeyFragment : BaseAccountFragment() {
.debounce(500, TimeUnit.MILLISECONDS)
.map { it.toString().trim() }
.observeOn(AndroidSchedulers.mainThread())
.subscribe { validateBrainKey(it) }
.subscribe(
{ validateBrainKey(it) },
{ Crashlytics.log(Log.DEBUG, TAG, it.message) }
)
)
btnImport.isEnabled = false