commit 4d2b5a6ff0f8e62a6df0f658cb6b2fbe98393732
parent 615b7da5ee39997e8a19b5f9ac004f06ab421779
Author: Torsten Grote <t@grobox.de>
Date: Wed, 28 Jun 2023 09:07:18 -0300
[wallet] small JSON error fixup
Diffstat:
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/wallet/src/main/java/net/taler/wallet/MainActivity.kt b/wallet/src/main/java/net/taler/wallet/MainActivity.kt
@@ -139,7 +139,6 @@ class MainActivity : AppCompatActivity(), OnNavigationItemSelectedListener,
}
if (it) barcodeLauncher.launch(scanOptions)
})
-
}
@Deprecated("Deprecated in Java")
@@ -296,10 +295,10 @@ class MainActivity : AppCompatActivity(), OnNavigationItemSelectedListener,
model.showProgressBar.value = false
when (status) {
is RefundStatus.Error -> {
- if (model.devMode.value == false) {
- showError(R.string.refund_error, status.error.userFacingMsg)
- } else {
+ if (model.devMode.value == true) {
showError(status.error)
+ } else {
+ showError(R.string.refund_error, status.error.userFacingMsg)
}
}
is RefundStatus.Success -> {
diff --git a/wallet/src/main/java/net/taler/wallet/Utils.kt b/wallet/src/main/java/net/taler/wallet/Utils.kt
@@ -138,7 +138,7 @@ fun Fragment.showError(error: TalerErrorInfo) {
prettyPrintIndent = " "
}
val message = json.encodeToString(error)
- this@showError.showError(message)
+ showError(message)
}
fun FragmentActivity.showError(error: TalerErrorInfo) {
@@ -148,5 +148,5 @@ fun FragmentActivity.showError(error: TalerErrorInfo) {
prettyPrintIndent = " "
}
val message = json.encodeToString(error)
- this@showError.showError(message)
-}
-\ No newline at end of file
+ showError(message)
+}
diff --git a/wallet/src/main/java/net/taler/wallet/exchanges/ExchangeManager.kt b/wallet/src/main/java/net/taler/wallet/exchanges/ExchangeManager.kt
@@ -60,6 +60,7 @@ class ExchangeManager(
scope.launch {
val response = api.request("listExchanges", ExchangeListResponse.serializer())
response.onError {
+ mProgress.value = false
mListError.value = it.toEvent()
}.onSuccess {
Log.d(TAG, "Exchange list: ${it.exchanges}")