aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxiphon <xiphon@protonmail.com>2020-10-02 11:12:20 +0000
committerxiphon <xiphon@protonmail.com>2020-10-02 11:12:20 +0000
commitff51dd08d33bdcdc70763ec6840909003895f593 (patch)
tree7b53f118508bb9ed2425e9392a52f3cf59692770
parenta32d39cc9689e994287a9b35304aa966ab42a371 (diff)
downloadmonzero-gui-ff51dd08d33bdcdc70763ec6840909003895f593.tar.gz
monzero-gui-ff51dd08d33bdcdc70763ec6840909003895f593.tar.xz
monzero-gui-ff51dd08d33bdcdc70763ec6840909003895f593.zip
History: fix amount handling for txex sent to the same account
-rw-r--r--pages/History.qml13
1 files changed, 6 insertions, 7 deletions
diff --git a/pages/History.qml b/pages/History.qml
index 9422593f..2c1b00e4 100644
--- a/pages/History.qml
+++ b/pages/History.qml
@@ -1488,13 +1488,12 @@ Rectangle {
var timestamp = new Date(date + " " + time).getTime() / 1000;
var dateHuman = Utils.ago(timestamp);
- var displayAmount = amount;
- if(displayAmount === 0){
- // *sometimes* amount is 0, while the 'destinations string'
+ if (amount === 0) {
+ // transactions to the same account have amount === 0, while the 'destinations string'
// has the correct amount, so we try to fetch it from that instead.
- displayAmount = TxUtils.destinationsToAmount(destinations);
- displayAmount = Number(displayAmount *1);
+ amount = Number(TxUtils.destinationsToAmount(destinations));
}
+ var displayAmount = Utils.removeTrailingZeros(amount.toFixed(12)) + " XMR";
var tx_note = currentWallet.getUserNote(hash);
var address = "";
@@ -1510,8 +1509,8 @@ Rectangle {
root.txModelData.push({
"i": i,
"isout": isout,
- "amount": Number(amount),
- "displayAmount": Utils.removeTrailingZeros(displayAmount.toFixed(12)) + " XMR",
+ "amount": amount,
+ "displayAmount": displayAmount,
"hash": hash,
"paymentId": paymentId,
"address": address,