Browse Source

switched date sorting to conf

all-modes
pbca26 8 years ago
parent
commit
058bafa293
  1. 11
      react/src/actions/actions/nativeSend.js
  2. 4
      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

11
react/src/actions/actions/nativeSend.js

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

4
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 = formatValue('round', _amount, -6);
if (_amount !== 'N/A') {
_amount = formatValue('round', _amount, -6);
}
items.push(
<li key={address}>

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

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

8
react/src/util/sort.js

@ -1,10 +1,10 @@
export function sortByDate(data) {
return data.sort(function(a, b) {
if (a.timestamp &&
b.timestamp) {
return b.timestamp - a.timestamp;
if (a.confirmations &&
b.confirmations) {
return a.confirmations - b.confirmations;
} 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()],
date = a.getDate(),
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(),
time = `${date} ${month} ${year} ${hour}:${min}${(showSeconds ? ':' + sec : '')}`;

Loading…
Cancel
Save