@@ -707,7 +707,7 @@ Ethplorer = {
707
707
if (
708
708
( Ethplorer . Storage . get ( 'showTx' ) === 'all' || Ethplorer . Storage . get ( 'showTx' ) === 'eth' ) &&
709
709
( ! txData . tx . operations || ! txData . tx . operations . length ) &&
710
- txData . tx . success && txData . tx . value > 0
710
+ txData . tx . value > 0
711
711
) {
712
712
$ ( '#token-operation-block' ) . show ( ) ;
713
713
$ ( '#token-operation-block .token-name:eq(0)' ) . html ( 'ETH' ) ;
@@ -719,21 +719,27 @@ Ethplorer = {
719
719
success : txData . tx . success ,
720
720
usdPrice : txData . tx . usdPrice
721
721
}
722
-
723
- Ethplorer . fillValues ( 'transfer' , txData , [ 'operation' , 'operation.from' , 'operation.to' ] ) ;
724
- Ethplorer . fillValues ( 'transfer' , txData , [ 'tx' , 'tx.timestamp' ] ) ;
725
722
726
- // Custom price value
723
+ var operationFields = [ 'operation' , 'operation.from' , 'operation.to' ] ;
727
724
var value = Ethplorer . Utils . formatNum ( txData . tx . value , true , 18 , true , true ) + ' <i class="fab fa-ethereum"></i> ETH' ;
728
- if ( txData . tx . value && Ethplorer . ethPrice . rate ) {
729
- value += '<br><span class="tx-value-price">$ ' + 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">$ ' + 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
+ }
734
734
}
735
+ $ ( '#transfer-operation-value' ) . html ( value ) ;
736
+ } else {
737
+ // if no history show with using fillValues
738
+ operationFields . push ( 'operation.valueEth' ) ;
735
739
}
736
- $ ( '#transfer-operation-value' ) . html ( value ) ;
740
+
741
+ Ethplorer . fillValues ( 'transfer' , txData , operationFields ) ;
742
+ Ethplorer . fillValues ( 'transfer' , txData , [ 'tx' , 'tx.timestamp' ] ) ;
737
743
738
744
if ( oTx . blockNumber && ! txData . pending ) {
739
745
$ ( '#txTokenStatus' ) [ txData . operation . success ? 'removeClass' : 'addClass' ] ( 'text-danger' ) ;
@@ -1839,7 +1845,7 @@ Ethplorer = {
1839
1845
var cls = change > 0 ? 'diff-up' : 'diff-down' ;
1840
1846
var diff = "" ;
1841
1847
// 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>' ;
1843
1849
}
1844
1850
}
1845
1851
value = res ;
0 commit comments