Browse Source

prevent tx re-sorting if txid a eq b

all-modes
pbca26 8 years ago
parent
commit
755f5dc1ec
  1. 8
      react/src/components/dashboard/walletsBalance/walletsBalance.render.js
  2. 12
      react/src/components/dashboard/walletsData/walletsData.js
  3. 5
      react/src/util/sort.js

8
react/src/components/dashboard/walletsBalance/walletsBalance.render.js

@ -37,7 +37,7 @@ const WalletsBalanceRender = function() {
</div>
<span
className="pull-right padding-top-10 font-size-22"
title={ Config.roundValues ? formatValue('round', this.renderBalance('transparent'), -6) : this.renderBalance('transparent') }>
title={ this.renderBalance('transparent') }>
{ Config.roundValues ? formatValue('round', this.renderBalance('transparent'), -6) : this.renderBalance('transparent') }
</span>
</div>
@ -57,7 +57,7 @@ const WalletsBalanceRender = function() {
</div>
<span
className="pull-right padding-top-10 font-size-22"
title={ Config.roundValues ? formatValue('round', this.renderBalance('private'), -6) : this.renderBalance('private') }>
title={ this.renderBalance('private') }>
{ Config.roundValues ? formatValue('round', this.renderBalance('private'), -6) : this.renderBalance('private') }
</span>
</div>
@ -78,7 +78,7 @@ const WalletsBalanceRender = function() {
</div>
<span
className="pull-right padding-top-10 font-size-22"
title={ Config.roundValues ? formatValue('round', this.renderBalance('interest'), -6) : this.renderBalance('interest') }>
title={ this.renderBalance('interest') }>
{ Config.roundValues ? formatValue('round', this.renderBalance('interest'), -6) : this.renderBalance('interest') }
</span>
</div>
@ -99,7 +99,7 @@ const WalletsBalanceRender = function() {
</div>
<span
className="pull-right padding-top-10 font-size-22"
title={ Config.roundValues ? formatValue('round', this.renderBalance('total'), -6) : this.renderBalance('total') }>
title={ this.renderBalance('total') }>
{ Config.roundValues ? formatValue('round', this.renderBalance('total'), -6) : this.renderBalance('total') }
</span>
</div>

12
react/src/components/dashboard/walletsData/walletsData.js

@ -550,12 +550,20 @@ class WalletsData extends React.Component {
if (_addresses.public[i].address === this.state.currentAddress) {
if (_addresses.public[i].amount &&
_addresses.public[i].amount !== 'N/A') {
return _addresses.public[i].amount;
let _amount = _addresses.public[i].amount;
if (_amount !== 'N/A') {
_amount = formatValue('round', _amount, -6);
}
return _amount;
} else {
const address = _addresses.public[i].address;
let _amount = _cache && _cache[_coin] && _cache[_coin][address] && _cache[_coin][address].getbalance.data && _cache[_coin][address].getbalance.data.balance ? _cache[_coin][address].getbalance.data.balance : 'N/A';
_amount = formatValue('round', _amount, -6);
if (_amount !== 'N/A') {
_amount = formatValue('round', _amount, -6);
}
return _amount;
}

5
react/src/util/sort.js

@ -1,8 +1,7 @@
export function sortByDate(data) {
return data.sort(function(a, b) {
if (a.confirmations &&
b.confirmations) {
return a.confirmations - b.confirmations;
if (a.txid === b.txid) {
return 1;
} else {
return a.confirmations - b.confirmations;
}

Loading…
Cancel
Save