aboutsummaryrefslogtreecommitdiff
path: root/cashier/src/main
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2021-08-27 16:43:46 +0200
committerTorsten Grote <t@grobox.de>2021-08-27 16:43:46 +0200
commitb663081104dc38df462c30d7dfc90e435ef3cf6c (patch)
treefce942ffc2eedfdb2a32ef4aa4f838c9b65e25c6 /cashier/src/main
parent06f16a7477b337f07526285b65a7f3003b814d33 (diff)
downloadtaler-android-b663081104dc38df462c30d7dfc90e435ef3cf6c.tar.gz
taler-android-b663081104dc38df462c30d7dfc90e435ef3cf6c.tar.bz2
taler-android-b663081104dc38df462c30d7dfc90e435ef3cf6c.zip
Update libraries and do associated maintenance
Diffstat (limited to 'cashier/src/main')
-rw-r--r--cashier/src/main/java/net/taler/cashier/Response.kt4
-rw-r--r--cashier/src/main/java/net/taler/cashier/config/ConfigFragment.kt2
-rw-r--r--cashier/src/main/java/net/taler/cashier/config/ConfigManager.kt4
-rw-r--r--cashier/src/main/java/net/taler/cashier/withdraw/WithdrawManager.kt12
4 files changed, 11 insertions, 11 deletions
diff --git a/cashier/src/main/java/net/taler/cashier/Response.kt b/cashier/src/main/java/net/taler/cashier/Response.kt
index c5b1c32..6a72604 100644
--- a/cashier/src/main/java/net/taler/cashier/Response.kt
+++ b/cashier/src/main/java/net/taler/cashier/Response.kt
@@ -39,12 +39,12 @@ class Response<out T> private constructor(
}
private suspend fun getFailure(e: Throwable): Failure = when (e) {
- is ResponseException -> Failure(e, getExceptionString(e), e.response?.status)
+ is ResponseException -> Failure(e, getExceptionString(e), e.response.status)
else -> Failure(e, e.toString())
}
private suspend fun getExceptionString(e: ResponseException): String {
- val response = e.response ?: return e.toString()
+ val response = e.response
return try {
Log.e("TEST", "TRY RECEIVE $response")
val error: Error = response.receive()
diff --git a/cashier/src/main/java/net/taler/cashier/config/ConfigFragment.kt b/cashier/src/main/java/net/taler/cashier/config/ConfigFragment.kt
index 6498590..e6ac249 100644
--- a/cashier/src/main/java/net/taler/cashier/config/ConfigFragment.kt
+++ b/cashier/src/main/java/net/taler/cashier/config/ConfigFragment.kt
@@ -130,7 +130,7 @@ class ConfigFragment : Fragment() {
return true
}
- private val onConfigResult = Observer<ConfigResult> { result ->
+ private val onConfigResult = Observer<ConfigResult?> { result ->
if (result == null) return@Observer
when (result) {
is ConfigResult.Success -> {
diff --git a/cashier/src/main/java/net/taler/cashier/config/ConfigManager.kt b/cashier/src/main/java/net/taler/cashier/config/ConfigManager.kt
index e9f4117..0718963 100644
--- a/cashier/src/main/java/net/taler/cashier/config/ConfigManager.kt
+++ b/cashier/src/main/java/net/taler/cashier/config/ConfigManager.kt
@@ -75,8 +75,8 @@ class ConfigManager(
)
internal val currency: LiveData<String> = mCurrency
- private val mConfigResult = MutableLiveData<ConfigResult>()
- val configResult: LiveData<ConfigResult> = mConfigResult
+ private val mConfigResult = MutableLiveData<ConfigResult?>()
+ val configResult: LiveData<ConfigResult?> = mConfigResult
fun hasConfig() = config.bankUrl.isNotEmpty()
&& config.username.isNotEmpty()
diff --git a/cashier/src/main/java/net/taler/cashier/withdraw/WithdrawManager.kt b/cashier/src/main/java/net/taler/cashier/withdraw/WithdrawManager.kt
index 30ff3d8..5d34bba 100644
--- a/cashier/src/main/java/net/taler/cashier/withdraw/WithdrawManager.kt
+++ b/cashier/src/main/java/net/taler/cashier/withdraw/WithdrawManager.kt
@@ -61,14 +61,14 @@ class WithdrawManager(
private var withdrawStatusCheck: Job? = null
- private val mWithdrawAmount = MutableLiveData<Amount>()
- val withdrawAmount: LiveData<Amount> = mWithdrawAmount
+ private val mWithdrawAmount = MutableLiveData<Amount?>()
+ val withdrawAmount: LiveData<Amount?> = mWithdrawAmount
- private val mWithdrawResult = MutableLiveData<WithdrawResult>()
- val withdrawResult: LiveData<WithdrawResult> = mWithdrawResult
+ private val mWithdrawResult = MutableLiveData<WithdrawResult?>()
+ val withdrawResult: LiveData<WithdrawResult?> = mWithdrawResult
- private val mWithdrawStatus = MutableLiveData<WithdrawStatus>()
- val withdrawStatus: LiveData<WithdrawStatus> = mWithdrawStatus
+ private val mWithdrawStatus = MutableLiveData<WithdrawStatus?>()
+ val withdrawStatus: LiveData<WithdrawStatus?> = mWithdrawStatus
private val mLastTransaction = MutableLiveData<LastTransaction>()
val lastTransaction: LiveData<LastTransaction> = mLastTransaction