mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-22 12:29:37 +00:00
fix(@desktop/wallet): Prevent nil conversion to qvariant (#12546)
This commit is contained in:
parent
cb703a44a4
commit
b1a8fd6260
@ -119,6 +119,7 @@ QtObject:
|
||||
return currencyAmountToItem(self.currencyService.parseCurrencyValue(symbol, amount),
|
||||
self.currencyService.getCurrencyFormat(symbol))
|
||||
|
||||
self.activityDetails = nil
|
||||
let entry = self.model.getEntry(entryIndex)
|
||||
if entry == nil:
|
||||
error "failed to find entry with index: ", entryIndex
|
||||
@ -127,11 +128,12 @@ QtObject:
|
||||
try:
|
||||
self.activityDetails = newActivityDetails(entry.getMetadata(), amountToCurrencyConvertor)
|
||||
except Exception as e:
|
||||
let errDescription = e.msg
|
||||
error "error: ", errDescription
|
||||
error "error: ", e.msg
|
||||
return
|
||||
|
||||
proc getActivityDetails(self: Controller): QVariant {.slot.} =
|
||||
if self.activityDetails == nil:
|
||||
return newQVariant()
|
||||
return newQVariant(self.activityDetails)
|
||||
|
||||
QtProperty[QVariant] activityDetails:
|
||||
|
@ -467,7 +467,7 @@ Item {
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
title: qsTr("Token format")
|
||||
subTitle: root.isTransactionValid ? d.details.tokenType.toUpperCase() : ""
|
||||
subTitle: d.isDetailsValid ? d.details.tokenType.toUpperCase() : ""
|
||||
visible: !!subTitle
|
||||
}
|
||||
TransactionDataTile {
|
||||
|
@ -52,7 +52,7 @@ StatusListItem {
|
||||
readonly property int transactionStatus: isModelDataValid ? modelData.status : Constants.TransactionStatus.Pending
|
||||
readonly property bool isMultiTransaction: isModelDataValid && modelData.isMultiTransaction
|
||||
readonly property string currentCurrency: rootStore.currentCurrency
|
||||
readonly property double cryptoValue: isModelDataValid && !isMultiTransaction ? modelData.amount : 0.0
|
||||
readonly property double cryptoValue: isModelDataValid ? modelData.amount : 0.0
|
||||
readonly property double fiatValue: isModelDataValid && !isMultiTransaction ? rootStore.getFiatValue(cryptoValue, modelData.symbol, currentCurrency) : 0.0
|
||||
readonly property double inCryptoValue: isModelDataValid ? modelData.inAmount : 0.0
|
||||
readonly property double inFiatValue: isModelDataValid && isMultiTransaction ? rootStore.getFiatValue(inCryptoValue, modelData.inSymbol, currentCurrency): 0.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user