8000 Merge branch 'pending-transactions' into develop · etherscan-io/Ethplorer@6db9478 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6db9478

Browse files
committed
Merge branch 'pending-transactions' into develop
2 parents 416e395 + 92fbde4 commit 6db9478

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

js/ethplorer.js

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ Ethplorer = {
707707
if (
708708
(Ethplorer.Storage.get('showTx') === 'all' || Ethplorer.Storage.get('showTx') === 'eth') &&
709709
(!txData.tx.operations || !txData.tx.operations.length) &&
710-
txData.tx.success && txData.tx.value > 0
710+
txData.tx.value > 0
711711
) {
712712
$('#token-operation-block').show();
713713
$('#token-operation-block .token-name:eq(0)').html('ETH');
@@ -719,21 +719,27 @@ Ethplorer = {
719719
success: txData.tx.success,
720720
usdPrice: txData.tx.usdPrice
721721
}
722-
723-
Ethplorer.fillValues('transfer', txData, ['operation', 'operation.from', 'operation.to']);
724-
Ethplorer.fillValues('transfer', txData, ['tx', 'tx.timestamp']);
725722

726-
// Custom price value
723+
var operationFields = ['operation', 'operation.from', 'operation.to'];
727724
var value = Ethplorer.Utils.formatNum(txData.tx.value, true, 18, true, true) + '&nbsp;<i class="fab fa-ethereum"></i>&nbsp;ETH';
728-
if(txData.tx.value && Ethplorer.ethPrice.rate) {
729-
value += '<br><span class="tx-value-price">$&nbsp;' + Ethplorer.Utils.formatNum(Ethplorer.ethPrice.rate * txData.tx.value, true, 2, true, true) + '</span>';
730-
if (txData.tx.usdPrice) {
731-
value += getHistDiffPriceString(txData.tx.usdPrice, Ethplorer.ethPrice.rate);
732-
// Price of eth on transaction exceute
733-
$('#historical-price').html(getHistUsdPriceString(txData.tx.usdPrice, txData.tx.value));
725+
if (txData.tx.success) {
726+
// Custom price value
727+
if(txData.tx.value && Ethplorer.ethPrice.rate) {
728+
value += '<br><span class="tx-value-price">$&nbsp;' + Ethplorer.Utils.formatNum(Ethplorer.ethPrice.rate * txData.tx.value, true, 2, true, true) + '</span>';
729+
if (txData.tx.usdPrice) {
730+
value += getHistDiffPriceString(txData.tx.usdPrice, Ethplorer.ethPrice.rate);
731+
// Price of eth on transaction exceute
732+
$('#historical-price').html(getHistUsdPriceString(txData.tx.usdPrice, txData.tx.value));
733+
}
734734
}
735+
$('#transfer-operation-value').html(value);
736+
} else {
737+
// if no history show with using fillValues
738+
operationFields.push('operation.valueEth');
735739
}
736-
$('#transfer-operation-value').html(value);
740+
741+
Ethplorer.fillValues('transfer', txData, operationFields);
742+
Ethplorer.fillValues('transfer', txData, ['tx', 'tx.timestamp']);
737743

738744
if(oTx.blockNumber && !txData.pending){
739745
$('#txTokenStatus')[txData.operation.success ? 'removeClass' : 'addClass']('text-danger');
@@ -1839,7 +1845,7 @@ Ethplorer = {
18391845
var cls = change > 0 ? 'diff-up' : 'diff-down';
18401846
var diff = "";
18411847
// var diff = change ? (' <span class="' + cls + '">(' + Ethplorer.Utils.round(change, 2) + '%)</span>') : '';
1842-
res = res + '<br /><span class="transfer-usd tx-value-price">$ ' + price + diff + '</span>';
1848+
res = res + '<br /><span class="tx-value-price">$ ' + price + diff + '</span>';
18431849
}
18441850
}
18451851
value = res;

0 commit comments

Comments
 (0)
0