History: fix failed and pending tx statuses

This commit is contained in:
xiphon 2020-10-15 10:22:29 +00:00
parent cb1f3ad0ce
commit 79ee893499

View file

@ -764,12 +764,18 @@ Rectangle {
font.pixelSize: 15 font.pixelSize: 15
text: { text: {
if (isout) { if (isout) {
if (isFailed) {
return qsTr("Failed") + translationManager.emptyString;
}
if (isPending) {
return qsTr("Waiting confirmation...") + translationManager.emptyString;
}
if (address) { if (address) {
const addressBookName = currentWallet ? currentWallet.addressBook.getDescription(address) : null; const addressBookName = currentWallet ? currentWallet.addressBook.getDescription(address) : null;
return (addressBookName ? FontAwesome.addressBook + " " + addressBookName : TxUtils.addressTruncate(address, 8)); return (addressBookName ? FontAwesome.addressBook + " " + addressBookName : TxUtils.addressTruncate(address, 8));
} }
if (amount != 0) { if (amount != 0) {
return (blockheight ? qsTr("Unknown recipient") : qsTr("Waiting confirmation...")) + translationManager.emptyString; return qsTr("Unknown recipient") + translationManager.emptyString;
} else { } else {
return qsTr("My wallet") + translationManager.emptyString; return qsTr("My wallet") + translationManager.emptyString;
} }
@ -1489,6 +1495,8 @@ Rectangle {
for (var i = 0; i < count; ++i) { for (var i = 0; i < count; ++i) {
var idx = _model.index(i, 0); var idx = _model.index(i, 0);
var isPending = model.data(idx, TransactionHistoryModel.TransactionPendingRole);
var isFailed = model.data(idx, TransactionHistoryModel.TransactionFailedRole);
var isout = _model.data(idx, TransactionHistoryModel.TransactionIsOutRole); var isout = _model.data(idx, TransactionHistoryModel.TransactionIsOutRole);
var amount = _model.data(idx, TransactionHistoryModel.TransactionAmountRole); var amount = _model.data(idx, TransactionHistoryModel.TransactionAmountRole);
var hash = _model.data(idx, TransactionHistoryModel.TransactionHashRole); var hash = _model.data(idx, TransactionHistoryModel.TransactionHashRole);
@ -1525,6 +1533,8 @@ Rectangle {
root.txModelData.push({ root.txModelData.push({
"i": i, "i": i,
"isPending": isPending,
"isFailed": isFailed,
"isout": isout, "isout": isout,
"amount": amount, "amount": amount,
"displayAmount": displayAmount, "displayAmount": displayAmount,