diff --git a/react/src/actions/actionCreators.js b/react/src/actions/actionCreators.js index bcf9a16..d41cf07 100644 --- a/react/src/actions/actionCreators.js +++ b/react/src/actions/actionCreators.js @@ -1753,6 +1753,47 @@ export function createNewWallet(_passphrase) { } } +export function deleteCacheFile(_payload) { + return dispatch => { + return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/groom?', { + method: 'DELETE', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ 'filename': _payload.pubkey }), + }) + .catch(function(error) { + console.log(error); + dispatch(triggerToaster(true, 'deleteCacheFile', 'Error', 'error')) + }) + .then(response => response.json()) + .then(json => dispatch(fetchNewCacheData(_payload))); + } +} + +export function fetchNewCacheData(_payload) { + const _userpass = '?userpass=tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'); + const _pubkey = '&pubkey=' + _payload.pubkey; + const _route = _payload.allcoins ? 'cache-all' : 'cache-one'; + const _coin = '&coin=' + _payload.coin; + const _calls = '&calls=' + _payload.calls; + + return dispatch => { + return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/' + _route + _userpass + _pubkey + _coin + _calls, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }) + .catch(function(error) { + console.log(error); + dispatch(triggerToaster(true, 'fetchNewCacheData', 'Error', 'error')); + }) + .then(response => response.json()) + .then(json => console.log(json)) + } +} + /*function Shepherd_SendPendValue() { Shepherd_SysInfo().then(function(result){ var ram_data = formatBytes(result.totalmem_bytes) diff --git a/react/src/components/dashboard/walletsData.js b/react/src/components/dashboard/walletsData.js index ce15741..c5636e6 100644 --- a/react/src/components/dashboard/walletsData.js +++ b/react/src/components/dashboard/walletsData.js @@ -8,7 +8,8 @@ import { toggleDashboardTxInfoModal, getBasiliskTransactionsList, changeMainBasiliskAddress, - displayNotariesModal + displayNotariesModal, + deleteCacheFile } from '../../actions/actionCreators'; import Store from '../../store'; @@ -41,6 +42,7 @@ class WalletsData extends React.Component { this.getDexNotariesAction = this.getDexNotariesAction.bind(this); this.openDropMenu = this.openDropMenu.bind(this); this.refreshTxList = this.refreshTxList.bind(this); + this.removeAndfetchNewCache = this.removeAndfetchNewCache.bind(this); socket.on('messages', msg => this.updateSocketsData(msg)); } @@ -64,6 +66,15 @@ class WalletsData extends React.Component { } } + removeAndfetchNewCache() { + Store.dispatch(deleteCacheFile({ + 'pubkey': this.props.Dashboard.activeHandle.pubkey, + 'allcoins': false, + 'coin': this.props.ActiveCoin.coin, + 'calls': 'listtransactions:getbalance', + })); + } + toggleBasiliskActionsMenu() { this.setState(Object.assign({}, this.state, { basiliskActionsMenu: !this.state.basiliskActionsMenu, @@ -374,7 +385,7 @@ class WalletsData extends React.Component {
  • - + {translate('INDEX.REFETCH_WALLET_DATA')}
  • diff --git a/react/src/components/dashboard/walletsNotariesList.js b/react/src/components/dashboard/walletsNotariesList.js index 1808888..17410de 100644 --- a/react/src/components/dashboard/walletsNotariesList.js +++ b/react/src/components/dashboard/walletsNotariesList.js @@ -4,6 +4,7 @@ import { secondsToString } from '../../util/time'; import { toggleDashboardTxInfoModal, displayNotariesModal } from '../../actions/actionCreators'; import Store from '../../store'; import Tree, { TreeNode } from 'rc-tree'; +import cssAnimation from 'css-animation'; function animate(node, show, done) { let height = node.offsetHeight; diff --git a/react/src/index.js b/react/src/index.js index d645de7..801e9ba 100644 --- a/react/src/index.js +++ b/react/src/index.js @@ -5,22 +5,8 @@ import { Provider } from 'react-redux'; import store from './store'; import App from './components/app/app'; -//import Wallets from './components/wallets/wallets'; -//import AtomicExplorer from './components/atomicExplorer/AtomicExplorer'; -//import EasyDEX from './components/easyDex/easyDex'; -//import Jumblr from './components/jumblr/jumblr'; -//import Settings from './components/settings/settings'; -//import About from './components/settings/about'; - import './styles/index.scss'; -// -// -// -// -// -// - const router = (