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'; import Settings from '../settings/settings';
export const LoginSettingsModalRender = function() { export const LoginSettingsModalRender = function() {
console.log(this.props);
return ( return (
<div> <div>
<div className="modal show login-settings-modal"> <div className="modal show login-settings-modal">

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

@ -1,6 +1,10 @@
import React from 'react'; import React from 'react';
import { translate } from '../../../translate/translate'; import { translate } from '../../../translate/translate';
import { fetchNewCacheData } from '../../../actions/actionCreators'; import {
fetchNewCacheData,
getKMDBalanceTotal,
iguanaEdexBalance
} from '../../../actions/actionCreators';
import Store from '../../../store'; import Store from '../../../store';
import WalletsBalanceRender from './walletsBalance.render'; import WalletsBalanceRender from './walletsBalance.render';
@ -37,15 +41,26 @@ class WalletsBalance extends React.Component {
} }
refreshBalance() { refreshBalance() {
if (this.props.ActiveCoin.mode === 'basilisk') { const _mode = this.props.ActiveCoin.mode;
Store.dispatch(fetchNewCacheData({ const _coin = this.props.ActiveCoin.coin;
'pubkey': this.props.Dashboard.activeHandle.pubkey,
'allcoins': false, switch(_mode) {
'coin': this.props.ActiveCoin.coin, case 'basilisk':
'calls': 'getbalance', Store.dispatch(fetchNewCacheData({
'skip': true, 'pubkey': this.props.Dashboard.activeHandle.pubkey,
'address': this.state.currentAddress, '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 widget-shadow">
<div className="widget-content"> <div className="widget-content">
<i <i
className="icon fa-refresh manual-balance-refresh" className="icon fa-refresh manual-balance-refresh pointer"
onClick={ this.refreshBalance }></i> onClick={ this.refreshBalance }></i>
<div className="padding-20 padding-top-10"> <div className="padding-20 padding-top-10">
<div className="clearfix"> <div className="clearfix">

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

@ -17,7 +17,9 @@ import {
getDexNotaries, getDexNotaries,
deleteCacheFile, deleteCacheFile,
fetchNewCacheData, fetchNewCacheData,
fetchUtxoCache fetchUtxoCache,
getNativeTxHistory,
getFullTransactionsList
} from '../../../actions/actionCreators'; } from '../../../actions/actionCreators';
import Store from '../../../store'; import Store from '../../../store';
import { import {
@ -61,6 +63,7 @@ class WalletsData extends React.Component {
this.restartBasiliskInstance = this.restartBasiliskInstance.bind(this); this.restartBasiliskInstance = this.restartBasiliskInstance.bind(this);
this.basiliskRefreshActionOne = this.basiliskRefreshActionOne.bind(this); this.basiliskRefreshActionOne = this.basiliskRefreshActionOne.bind(this);
this.handleClickOutside = this.handleClickOutside.bind(this); this.handleClickOutside = this.handleClickOutside.bind(this);
this.refreshTxHistory = this.refreshTxHistory.bind(this);
socket.on('messages', msg => this.updateSocketsData(msg)); 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() { removeAndFetchNewCache() {
Store.dispatch(deleteCacheFile({ Store.dispatch(deleteCacheFile({
'pubkey': this.props.Dashboard.activeHandle.pubkey, '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="col-xlg-12 col-lg-12 col-sm-12 col-xs-12">
<div className="panel"> <div className="panel">
<header className="panel-heading z-index-10"> <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={ '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 className={ 'margin-bottom-3 ' + (this.state.currentStackLength === 1 || (this.state.currentStackLength === 0 && this.state.totalStackLength === 0) ? 'hide' : 'progress progress-sm') }>
<div <div

3
react/src/components/overrides.scss

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

Loading…
Cancel
Save