From b245d0af7a3ad7f361fde0274a77f88c7ca24daa Mon Sep 17 00:00:00 2001 From: selsta Date: Wed, 22 Apr 2020 22:06:22 +0200 Subject: [PATCH 1/4] MerchantTrackingList: point out unconfirmed amount --- pages/merchant/MerchantTrackingList.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 07ecca5af44dc96f0db169e90ec23ac706383b06 Mon Sep 17 00:00:00 2001 From: selsta Date: Wed, 22 Apr 2020 22:00:44 +0200 Subject: [PATCH 2/4] Merchant: fix payment URL This would previously get loaded on the Receive page. --- pages/merchant/Merchant.qml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pages/merchant/Merchant.qml b/pages/merchant/Merchant.qml index 545ba641..6ed20915 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(); From 3af99e91e4d61b1e63ab3ff780febc338e335add Mon Sep 17 00:00:00 2001 From: selsta Date: Wed, 22 Apr 2020 21:59:25 +0200 Subject: [PATCH 3/4] Merchant: remove unused variables --- pages/merchant/Merchant.qml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pages/merchant/Merchant.qml b/pages/merchant/Merchant.qml index 6ed20915..a474719a 100644 --- a/pages/merchant/Merchant.qml +++ b/pages/merchant/Merchant.qml @@ -592,7 +592,6 @@ Item { var model = appWindow.currentWallet.historyModel var count = model.rowCount() - var totalAmount = 0 var nTransactions = 0 var blockchainHeight = null var txs = [] @@ -610,8 +609,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); @@ -633,7 +630,6 @@ Item { txs.push({ "amount": displayAmount, "confirmations": confirmations, - "blockheight": blockHeight, "in_txpool": in_txpool, "txid": txid, "time_epoch": timeEpoch, @@ -653,9 +649,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, From 2102e4be0d0888e66b50ed71150fc9d4b1cb1566 Mon Sep 17 00:00:00 2001 From: selsta Date: Wed, 22 Apr 2020 22:05:20 +0200 Subject: [PATCH 4/4] Merchant: fix confirmations --- pages/merchant/Merchant.qml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pages/merchant/Merchant.qml b/pages/merchant/Merchant.qml index a474719a..8602945a 100644 --- a/pages/merchant/Merchant.qml +++ b/pages/merchant/Merchant.qml @@ -593,7 +593,6 @@ Item { var model = appWindow.currentWallet.historyModel var count = model.rowCount() var nTransactions = 0 - var blockchainHeight = null var txs = [] // Currently selected subaddress as per Receive page @@ -616,15 +615,12 @@ 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({