diff --git a/pages/merchant/Merchant.qml b/pages/merchant/Merchant.qml index 545ba641..8602945a 100644 --- a/pages/merchant/Merchant.qml +++ b/pages/merchant/Merchant.qml @@ -33,6 +33,9 @@ Item { property var hiddenAmounts: [] function onPageCompleted() { + if (appWindow.currentWallet) { + appWindow.current_address = appWindow.currentWallet.address(appWindow.currentWallet.currentSubaddressAccount, 0) + } // prepare tracking trackingCheckbox.checked = root.enableTracking root.update(); @@ -589,9 +592,7 @@ Item { var model = appWindow.currentWallet.historyModel var count = model.rowCount() - var totalAmount = 0 var nTransactions = 0 - var blockchainHeight = null var txs = [] // Currently selected subaddress as per Receive page @@ -607,8 +608,6 @@ Item { var subaddrIndex = model.data(idx, TransactionHistoryModel.TransactionSubaddrIndexRole); if (!isout && subaddrAccount == appWindow.currentWallet.currentSubaddressAccount && subaddrIndex == current_subaddress_table_index) { - var amount = model.data(idx, TransactionHistoryModel.TransactionAtomicAmountRole); - totalAmount = walletManager.addi(totalAmount, amount) nTransactions += 1 var txid = model.data(idx, TransactionHistoryModel.TransactionHashRole); @@ -616,21 +615,17 @@ Item { var in_txpool = false; var confirmations = 0; - var displayAmount = 0; + var displayAmount = model.data(idx, TransactionHistoryModel.TransactionDisplayAmountRole); - if (blockHeight == 0) { + if (blockHeight === undefined) { in_txpool = true; } else { - if (blockchainHeight == null) - blockchainHeight = walletManager.blockchainHeight() - confirmations = blockchainHeight - blockHeight - 1 - displayAmount = model.data(idx, TransactionHistoryModel.TransactionDisplayAmountRole); + confirmations = model.data(idx, TransactionHistoryModel.TransactionConfirmationsRole); } txs.push({ "amount": displayAmount, "confirmations": confirmations, - "blockheight": blockHeight, "in_txpool": in_txpool, "txid": txid, "time_epoch": timeEpoch, @@ -650,9 +645,7 @@ Item { txs.forEach(function(tx){ trackingModel.append({ "amount": tx.amount, - "blockheight": tx.blockheight, "confirmations": tx.confirmations, - "blockheight": tx.blockHeight, "in_txpool": tx.in_txpool, "txid": tx.txid, "time_epoch": tx.time_epoch, diff --git a/pages/merchant/MerchantTrackingList.qml b/pages/merchant/MerchantTrackingList.qml index 4c80b641..360cc644 100644 --- a/pages/merchant/MerchantTrackingList.qml +++ b/pages/merchant/MerchantTrackingList.qml @@ -125,7 +125,7 @@ ListView { font.pixelSize: 14 font.bold: true color: hide_amount ? "#707070" : "#009F1E" - text: hide_amount ? '-' : '+' + amount + text: hide_amount ? '-' : '+' + amount + (in_txpool ? ' (%1)'.arg(qsTr('unconfirmed')) : '') selectionColor: MoneroComponents.Style.textSelectionColor selectByMouse: true readOnly: true