Browse Source

manual balance and tx history refresh

all-modes
pbca26 8 years ago
parent
commit
16908a893e
  1. 2
      react/src/components/dashboard/loginSettingsModal/loginSettingsModal.render.js
  2. 35
      react/src/components/dashboard/walletsBalance/walletsBalance.js
  3. 2
      react/src/components/dashboard/walletsBalance/walletsBalance.render.js
  4. 30
      react/src/components/dashboard/walletsData/walletsData.js
  5. 3
      react/src/components/dashboard/walletsData/walletsData.render.js
  6. 3
      react/src/components/overrides.scss

2
react/src/components/dashboard/loginSettingsModal/loginSettingsModal.render.js

@ -4,8 +4,6 @@ import About from '../about/about';
import Settings from '../settings/settings';
export const LoginSettingsModalRender = function() {
console.log(this.props);
return (
<div>
<div className="modal show login-settings-modal">

35
react/src/components/dashboard/walletsBalance/walletsBalance.js

@ -1,6 +1,10 @@
import React from 'react';
import { translate } from '../../../translate/translate';
import { fetchNewCacheData } from '../../../actions/actionCreators';
import {
fetchNewCacheData,
getKMDBalanceTotal,
iguanaEdexBalance
} from '../../../actions/actionCreators';
import Store from '../../../store';
import WalletsBalanceRender from './walletsBalance.render';
@ -37,15 +41,26 @@ class WalletsBalance extends React.Component {
}
refreshBalance() {
if (this.props.ActiveCoin.mode === 'basilisk') {
Store.dispatch(fetchNewCacheData({
'pubkey': this.props.Dashboard.activeHandle.pubkey,
'allcoins': false,
'coin': this.props.ActiveCoin.coin,
'calls': 'getbalance',
'skip': true,
'address': this.state.currentAddress,
}));
const _mode = this.props.ActiveCoin.mode;
const _coin = this.props.ActiveCoin.coin;
switch(_mode) {
case 'basilisk':
Store.dispatch(fetchNewCacheData({
'pubkey': this.props.Dashboard.activeHandle.pubkey,
'allcoins': false,
'coin': this.props.ActiveCoin.coin,
'calls': 'getbalance',
'skip': true,
'address': this.state.currentAddress,
}));
break;
case 'native':
Store.dispatch(getKMDBalanceTotal(_coin));
break;
case 'full':
Store.dispatch(iguanaEdexBalance(_coin));
break;
}
}

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

@ -27,7 +27,7 @@ const WalletsBalanceRender = function() {
<div className="widget widget-shadow">
<div className="widget-content">
<i
className="icon fa-refresh manual-balance-refresh"
className="icon fa-refresh manual-balance-refresh pointer"
onClick={ this.refreshBalance }></i>
<div className="padding-20 padding-top-10">
<div className="clearfix">

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

@ -17,7 +17,9 @@ import {
getDexNotaries,
deleteCacheFile,
fetchNewCacheData,
fetchUtxoCache
fetchUtxoCache,
getNativeTxHistory,
getFullTransactionsList
} from '../../../actions/actionCreators';
import Store from '../../../store';
import {
@ -61,6 +63,7 @@ class WalletsData extends React.Component {
this.restartBasiliskInstance = this.restartBasiliskInstance.bind(this);
this.basiliskRefreshActionOne = this.basiliskRefreshActionOne.bind(this);
this.handleClickOutside = this.handleClickOutside.bind(this);
this.refreshTxHistory = this.refreshTxHistory.bind(this);
socket.on('messages', msg => this.updateSocketsData(msg));
}
@ -137,6 +140,31 @@ class WalletsData extends React.Component {
}
}
refreshTxHistory() {
const _mode = this.props.ActiveCoin.mode;
const _coin = this.props.ActiveCoin.coin;
switch(_mode) {
case 'basilisk':
Store.dispatch(fetchNewCacheData({
'pubkey': this.props.Dashboard.activeHandle.pubkey,
'allcoins': false,
'coin': _coin,
'calls': 'listtransactions',
'skip': true,
'address': this.state.currentAddress,
}));
break;
case 'native':
console.log('refresh');
Store.dispatch(getNativeTxHistory(_coin));
break;
case 'full':
Store.dispatch(getFullTransactionsList(_coin));
break;
}
}
removeAndFetchNewCache() {
Store.dispatch(deleteCacheFile({
'pubkey': this.props.Dashboard.activeHandle.pubkey,

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

@ -157,6 +157,9 @@ export const WalletsDataRender = function() {
<div className="col-xlg-12 col-lg-12 col-sm-12 col-xs-12">
<div className="panel">
<header className="panel-heading z-index-10">
<i
className="icon fa-refresh manual-txhistory-refresh pointer"
onClick={ this.refreshTxHistory }></i>
<div className={ 'panel-actions' + (this.props.ActiveCoin.mode === 'basilisk' ? '' : ' hide') }>
<div className={ 'margin-bottom-3 ' + (this.state.currentStackLength === 1 || (this.state.currentStackLength === 0 && this.state.totalStackLength === 0) ? 'hide' : 'progress progress-sm') }>
<div

3
react/src/components/overrides.scss

@ -643,7 +643,8 @@ select{
background: #f3f4f5;
}
.manual-balance-refresh {
.manual-balance-refresh,
.manual-txhistory-refresh {
position: absolute;
right: 4px;
top: 3px;

Loading…
Cancel
Save