Prompt update on MobileCoin enclave failure.

This commit is contained in:
Varsha
2022-11-01 11:33:43 -07:00
committed by Cody Henthorne
parent 2709f0ee0d
commit b38ac44d0f
9 changed files with 181 additions and 19 deletions

View File

@@ -68,6 +68,7 @@ internal class PaymentsValues internal constructor(store: KeyValueStore) : Signa
get() = getBoolean(USER_CONFIRMED_MNEMONIC_LARGE_BALANCE, false)
set(value) = putBoolean(USER_CONFIRMED_MNEMONIC_LARGE_BALANCE, value)
private val liveCurrentCurrency: MutableLiveData<Currency> by lazy { MutableLiveData(currentCurrency()) }
private val enclaveFailure: MutableLiveData<Boolean> by lazy { MutableLiveData(false) }
private val liveMobileCoinLedger: MutableLiveData<MobileCoinLedgerWrapper> by lazy { MutableLiveData(mobileCoinLatestFullLedger()) }
private val liveMobileCoinBalance: LiveData<Balance> by lazy { Transformations.map(liveMobileCoinLedger) { obj: MobileCoinLedgerWrapper -> obj.balance } }
@@ -214,6 +215,15 @@ internal class PaymentsValues internal constructor(store: KeyValueStore) : Signa
return liveCurrentCurrency
}
fun setEnclaveFailure(failure: Boolean) {
enclaveFailure.postValue(failure)
}
fun enclaveFailure(): LiveData<Boolean> {
return enclaveFailure
}
fun showAboutMobileCoinInfoCard(): Boolean {
return store.getBoolean(SHOW_ABOUT_MOBILE_COIN_INFO_CARD, true)
}