Browse Source

switched date sorting to conf

all-modes
pbca26 8 years ago
parent
commit
058bafa293
  1. 9
      react/src/actions/actions/nativeSend.js
  2. 2
      react/src/components/dashboard/walletsData/walletsData.js
  3. 8
      react/src/components/dashboard/walletsData/walletsData.render.js
  4. 8
      react/src/util/sort.js
  5. 2
      react/src/util/time.js

9
react/src/actions/actions/nativeSend.js

@ -16,8 +16,9 @@ export function sendNativeTx(coin, _payload) {
let payload; let payload;
let _apiMethod; let _apiMethod;
if (_payload.addressType === 'public' && // transparent // iguana core
_payload.sendTo.length !== 95) { if ((_payload.addressType === 'public' && // transparent
_payload.sendTo.length !== 95) || !_payload.sendFrom) {
_apiMethod = 'sendtoaddress'; _apiMethod = 'sendtoaddress';
ajaxDataToHex = `["${_payload.sendTo}", ${Number(_payload.amount) - Number(_payload.fee)}]`; ajaxDataToHex = `["${_payload.sendTo}", ${Number(_payload.amount) - Number(_payload.fee)}]`;
} else { // private } else { // private
@ -61,13 +62,13 @@ export function sendNativeTx(coin, _payload) {
body: JSON.stringify(payload), body: JSON.stringify(payload),
}; };
if (Config.cli.default) { if (Config.cli.default) { // rpc
payload = { payload = {
mode: null, mode: null,
chain: coin, chain: coin,
cmd: payload.function, cmd: payload.function,
params: params:
_payload.addressType === 'public' && _payload.sendTo.length !== 95 ? (_payload.addressType === 'public' && _payload.sendTo.length !== 95) || !_payload.sendFrom ?
[ [
_payload.sendTo, _payload.sendTo,
_payload.amount _payload.amount

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

@ -485,7 +485,9 @@ class WalletsData extends React.Component {
_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 = _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';
} }
if (_amount !== 'N/A') {
_amount = formatValue('round', _amount, -6); _amount = formatValue('round', _amount, -6);
}
items.push( items.push(
<li key={address}> <li key={address}>

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

@ -177,19 +177,19 @@ export const WalletsDataRender = function() {
<span className="caret"></span> <span className="caret"></span>
</a> </a>
<ul className="dropdown-menu dropdown-menu-right"> <ul className="dropdown-menu dropdown-menu-right">
<li> <li className="hide">
<a onClick={ this.getDexNotariesAction }> <a onClick={ this.getDexNotariesAction }>
<i className="icon fa-sitemap"></i> { translate('INDEX.GET_NOTARY_NODES_LIST') } <i className="icon fa-sitemap"></i> { translate('INDEX.GET_NOTARY_NODES_LIST') }
</a> </a>
</li> </li>
<li> <li className="hide">
<a onClick={ this.basiliskConnectionAction }> <a onClick={ this.basiliskConnectionAction }>
<i className="icon wb-refresh"></i> { translate('INDEX.REFRESH_BASILISK_CONNECTIONS') } <i className="icon wb-refresh"></i> { translate('INDEX.REFRESH_BASILISK_CONNECTIONS') }
</a> </a>
</li> </li>
<li className={ !this.state.useCache ? 'hide' : '' }> <li className={ !this.state.useCache ? 'hide' : '' }>
<a onClick={ this.basiliskRefreshActionOne }> <a onClick={ this.basiliskRefreshActionOne }>
<i className="icon fa-cloud-download"></i> { translate('INDEX.FETCH_WALLET_DATA') } <i className="icon fa-cloud-download"></i> { translate('INDEX.FETCH_WALLET_DATA') }&nbsp;
({ translate('INDEX.ACTIVE_ADDRESS') }) ({ translate('INDEX.ACTIVE_ADDRESS') })
</a> </a>
</li> </li>
@ -209,7 +209,7 @@ export const WalletsDataRender = function() {
<i className="icon fa-refresh"></i> Restart Basilisk Instance (unsafe!) <i className="icon fa-refresh"></i> Restart Basilisk Instance (unsafe!)
</a> </a>
</li> </li>
<li className={ !this.state.useCache ? 'hide' : '' }> <li className="hide">
<a onClick={ this._toggleViewCacheModal }> <a onClick={ this._toggleViewCacheModal }>
<i className="icon fa-list-alt"></i> { translate('INDEX.VIEW_CACHE_DATA') } <i className="icon fa-list-alt"></i> { translate('INDEX.VIEW_CACHE_DATA') }
</a> </a>

8
react/src/util/sort.js

@ -1,10 +1,10 @@
export function sortByDate(data) { export function sortByDate(data) {
return data.sort(function(a, b) { return data.sort(function(a, b) {
if (a.timestamp && if (a.confirmations &&
b.timestamp) { b.confirmations) {
return b.timestamp - a.timestamp; return a.confirmations - b.confirmations;
} else { } else {
return b.blocktime - a.blocktime; return a.confirmations - b.confirmations;
} }
}); });
} }

2
react/src/util/time.js

@ -18,7 +18,7 @@ export function secondsToString(seconds, skipMultiply, showSeconds) {
month = months[a.getMonth()], month = months[a.getMonth()],
date = a.getDate(), date = a.getDate(),
hour = a.getHours() < 10 ? `0${a.getHours()}` : a.getHours(), hour = a.getHours() < 10 ? `0${a.getHours()}` : a.getHours(),
min = a.getMinutes() < 10 ? `0 ${a.getMinutes()}` : a.getMinutes(), min = a.getMinutes() < 10 ? `0${a.getMinutes()}` : a.getMinutes(),
sec = a.getSeconds(), sec = a.getSeconds(),
time = `${date} ${month} ${year} ${hour}:${min}${(showSeconds ? ':' + sec : '')}`; time = `${date} ${month} ${year} ${hour}:${min}${(showSeconds ? ':' + sec : '')}`;

Loading…
Cancel
Save