diff --git a/react/src/actions/actions/coinList.js b/react/src/actions/actions/coinList.js index 780c888..c078fb0 100644 --- a/react/src/actions/actions/coinList.js +++ b/react/src/actions/actions/coinList.js @@ -1,6 +1,54 @@ import { triggerToaster } from '../actionCreators'; import Config from '../../config'; +export function shepherdStopCoind(coin) { + return new Promise((resolve, reject) => { + fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/coind/stop`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: coin === 'KMD' ? '' : JSON.stringify({ chain: coin }), + }) + .catch((error) => { + console.log(error); + dispatch( + triggerToaster( + 'shepherdStopCoind', + 'Error', + 'error' + ) + ); + }) + .then(response => response.json()) + .then(json => resolve(json)) + }); +} + +export function shepherdRemoveCoin(coin) { + return new Promise((resolve, reject) => { + fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/coins/remove`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: coin === 'KMD' ? '' : JSON.stringify({ chain: coin }), + }) + .catch((error) => { + console.log(error); + dispatch( + triggerToaster( + 'shepherdRemoveCoin', + 'Error', + 'error' + ) + ); + }) + .then(response => response.json()) + .then(json => resolve(json)) + }); +} + export function shepherdGetCoinList() { return new Promise((resolve, reject) => { fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/coinslist`, { diff --git a/react/src/actions/actions/electrum.js b/react/src/actions/actions/electrum.js index 548f5b1..6e27239 100644 --- a/react/src/actions/actions/electrum.js +++ b/react/src/actions/actions/electrum.js @@ -114,7 +114,7 @@ export function shepherdElectrumBalance(coin, address) { 'Error', 'error' ) - ) + ); }) .then(response => response.json()) .then(json => { @@ -146,7 +146,7 @@ export function shepherdElectrumTransactions(coin, address) { 'Error', 'error' ) - ) + ); }) .then(response => response.json()) .then(json => { @@ -187,7 +187,7 @@ export function shepherdElectrumCoins() { 'Error', 'error' ) - ) + ); }) .then(response => response.json()) .then(json => { @@ -220,7 +220,7 @@ export function shepherdElectrumSend(coin, value, sendToAddress, changeAddress) 'Error', 'error' ) - ) + ); }) .then(response => response.json()) .then(json => { @@ -249,7 +249,7 @@ export function shepherdElectrumSendPreflight(coin, value, sendToAddress, change 'Error', 'error' ) - ) + ); }) .then(response => response.json()) .then(json => { diff --git a/react/src/actions/actions/nativeDashboardUpdate.js b/react/src/actions/actions/nativeDashboardUpdate.js index 172e2fa..af3cd75 100644 --- a/react/src/actions/actions/nativeDashboardUpdate.js +++ b/react/src/actions/actions/nativeDashboardUpdate.js @@ -31,8 +31,9 @@ export function getDashboardUpdate(coin, activeCoinProps) { dispatch(getDashboardUpdateState(json, coin)); // dirty hack to trigger dashboard render - if (!activeCoinProps.balance && - !activeCoinProps.addresses) { + if (!activeCoinProps || (activeCoinProps && + !activeCoinProps.balance && + !activeCoinProps.addresses)) { setTimeout(() => { dispatch(getDashboardUpdateState(json, coin)); }, 100); diff --git a/react/src/components/dashboard/claimInterestModal/claimInterestModal.render.js b/react/src/components/dashboard/claimInterestModal/claimInterestModal.render.js index 419d603..1d02e97 100644 --- a/react/src/components/dashboard/claimInterestModal/claimInterestModal.render.js +++ b/react/src/components/dashboard/claimInterestModal/claimInterestModal.render.js @@ -1,8 +1,6 @@ import React from 'react'; import { translate } from '../../../translate/translate'; -const MIN_INTEREST_THRESHOLD = 0.001; - export const _ClaimInterestTableRender = function() { const _transactionsList = this.state.transactionsList; let _items = []; @@ -11,7 +9,7 @@ export const _ClaimInterestTableRender = function() { if ((_transactionsList[i].interest === 0 && this.state.showZeroInterest) || (_transactionsList[i].amount > 0 && _transactionsList[i].interest > 0)) { _items.push( - +