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),
|
return currencyAmountToItem(self.currencyService.parseCurrencyValue(symbol, amount),
|
||||||
self.currencyService.getCurrencyFormat(symbol))
|
self.currencyService.getCurrencyFormat(symbol))
|
||||||
|
|
||||||
|
self.activityDetails = nil
|
||||||
let entry = self.model.getEntry(entryIndex)
|
let entry = self.model.getEntry(entryIndex)
|
||||||
if entry == nil:
|
if entry == nil:
|
||||||
error "failed to find entry with index: ", entryIndex
|
error "failed to find entry with index: ", entryIndex
|
||||||
@ -127,11 +128,12 @@ QtObject:
|
|||||||
try:
|
try:
|
||||||
self.activityDetails = newActivityDetails(entry.getMetadata(), amountToCurrencyConvertor)
|
self.activityDetails = newActivityDetails(entry.getMetadata(), amountToCurrencyConvertor)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
let errDescription = e.msg
|
error "error: ", e.msg
|
||||||
error "error: ", errDescription
|
|
||||||
return
|
return
|
||||||
|
|
||||||
proc getActivityDetails(self: Controller): QVariant {.slot.} =
|
proc getActivityDetails(self: Controller): QVariant {.slot.} =
|
||||||
|
if self.activityDetails == nil:
|
||||||
|
return newQVariant()
|
||||||
return newQVariant(self.activityDetails)
|
return newQVariant(self.activityDetails)
|
||||||
|
|
||||||
QtProperty[QVariant] activityDetails:
|
QtProperty[QVariant] activityDetails:
|
||||||
|
@ -467,7 +467,7 @@ Item {
|
|||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
title: qsTr("Token format")
|
title: qsTr("Token format")
|
||||||
subTitle: root.isTransactionValid ? d.details.tokenType.toUpperCase() : ""
|
subTitle: d.isDetailsValid ? d.details.tokenType.toUpperCase() : ""
|
||||||
visible: !!subTitle
|
visible: !!subTitle
|
||||||
}
|
}
|
||||||
TransactionDataTile {
|
TransactionDataTile {
|
||||||
|
@ -52,7 +52,7 @@ StatusListItem {
|
|||||||
readonly property int transactionStatus: isModelDataValid ? modelData.status : Constants.TransactionStatus.Pending
|
readonly property int transactionStatus: isModelDataValid ? modelData.status : Constants.TransactionStatus.Pending
|
||||||
readonly property bool isMultiTransaction: isModelDataValid && modelData.isMultiTransaction
|
readonly property bool isMultiTransaction: isModelDataValid && modelData.isMultiTransaction
|
||||||
readonly property string currentCurrency: rootStore.currentCurrency
|
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 fiatValue: isModelDataValid && !isMultiTransaction ? rootStore.getFiatValue(cryptoValue, modelData.symbol, currentCurrency) : 0.0
|
||||||
readonly property double inCryptoValue: isModelDataValid ? modelData.inAmount : 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
|
readonly property double inFiatValue: isModelDataValid && isMultiTransaction ? rootStore.getFiatValue(inCryptoValue, modelData.inSymbol, currentCurrency): 0.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user