diff --git a/react/src/actions/addCoin.js b/react/src/actions/addCoin.js index 7d7a5fc..7fd8e06 100644 --- a/react/src/actions/addCoin.js +++ b/react/src/actions/addCoin.js @@ -4,7 +4,8 @@ import { triggerToaster, Config, toggleAddcoinModal, - getDexCoins + getDexCoins, + startIguanaInstance } from './actionCreators'; import { logGuiHttp, diff --git a/react/src/components/dashboard/coinTileItem.js b/react/src/components/dashboard/coinTileItem.js index 092fb81..23607a7 100644 --- a/react/src/components/dashboard/coinTileItem.js +++ b/react/src/components/dashboard/coinTileItem.js @@ -21,6 +21,8 @@ import { } from '../../actions/actionCreators'; import Store from '../../store'; +const BASILISK_CACHE_UPDATE_TIMEOUT = 240000; + class CoinTileItem extends React.Component { constructor(props) { super(props); @@ -115,7 +117,7 @@ class CoinTileItem extends React.Component { this.dispatchCoinActions(coin, mode); }.bind(this), 3000); - const _basiliskCache = setInterval(function() { + const _basiliskCache = setInterval(() => { Store.dispatch(fetchNewCacheData({ 'pubkey': this.props.Dashboard.activeHandle.pubkey, 'allcoins': false, @@ -123,7 +125,7 @@ class CoinTileItem extends React.Component { 'calls': 'listtransactions:getbalance', 'address': _basiliskMainAddress, })); - }.bind(this), 240000); + }, BASILISK_CACHE_UPDATE_TIMEOUT); Store.dispatch(startInterval('sync', _iguanaActiveHandle)); Store.dispatch(startInterval('basilisk', _basiliskCache)); // basilisk diff --git a/react/src/components/dashboard/settings.js b/react/src/components/dashboard/settings.js index c140ddd..244f0c6 100644 --- a/react/src/components/dashboard/settings.js +++ b/react/src/components/dashboard/settings.js @@ -53,7 +53,8 @@ class Settings extends React.Component { } openTab(elemId, tab) { - const _height = document.querySelector('#' + elemId + ' .panel-collapse .panel-body').offsetHeight; + console.log(`#${elemId}.panel-collapse .panel-body`); + const _height = document.querySelector(`#${elemId} .panel-collapse .panel-body`).offsetHeight; this.setState(Object.assign({}, this.state, { activeTab: tab, @@ -217,8 +218,6 @@ class Settings extends React.Component { this.setState({ appSettings: _appSettings, }); - - console.log(this.state.appSettings); } _saveAppConfig() { diff --git a/react/src/components/dashboard/syncOnly.js b/react/src/components/dashboard/syncOnly.js index bcff8fe..4fffc24 100644 --- a/react/src/components/dashboard/syncOnly.js +++ b/react/src/components/dashboard/syncOnly.js @@ -1,5 +1,6 @@ import React from 'react'; import { translate } from '../../translate/translate'; +import { getCoinTitle } from '../../util/coinHelper'; import { stopInterval, addCoin, @@ -19,7 +20,8 @@ class SyncOnly extends React.Component { } isFullySynced(fork) { - if (fork.balances && ((Number(fork.balances) + + if (fork.balances && + ((Number(fork.balances) + Number(fork.validated) + Number(fork.bundles) + Number(fork.utxo)) / 4 === 100)) { @@ -30,96 +32,15 @@ class SyncOnly extends React.Component { } renderCoinName(coin) { - let coinlogo; - let coinname; - - switch (coin) { - case 'BTC': - coinlogo = 'bitcoin'; - coinname = 'Bitcoin'; - break; - case 'BTCD': - coinlogo = 'bitcoindark'; - coinname = 'BitcoinDark'; - break; - case 'LTC': - coinlogo = 'litecoin'; - coinname = 'Litecoin'; - break; - case 'VPN': - coinlogo = 'vpncoin'; - coinname = 'VPNcoin'; - break; - case 'SYS': - coinlogo = 'syscoin'; - coinname = 'Syscoin'; - break; - case 'ZEC': - coinlogo = 'zcash'; - coinname = 'Zcash'; - break; - case 'NMC': - coinlogo = 'namecoin'; - coinname = 'Namecoin'; - break; - case 'DEX': - coinlogo = 'dex'; - coinname = 'InstantDEX'; - break; - case 'DOGE': - coinlogo = 'dogecoin'; - coinname = 'Dogecoin'; - break; - case 'DGB': - coinlogo = 'digibyte'; - coinname = 'Digibyte'; - break; - case 'MZC': - coinlogo = 'mazacoin'; - coinname = 'Mazacoin'; - break; - case 'UNO': - coinlogo = 'unobtanium'; - coinname = 'Unobtanium'; - break; - case 'ZET': - coinlogo = 'zetacoin'; - coinname = 'Zetacoin'; - break; - case 'KMD': - coinlogo = 'komodo'; - coinname = 'Komodo'; - break; - case 'BTM': - coinlogo = 'bitmark'; - coinname = 'Bitmark'; - break; - case 'CARB': - coinlogo = 'carboncoin'; - coinname = 'Carboncoin'; - break; - case 'ANC': - coinlogo = 'anoncoin'; - coinname = 'AnonCoin'; - break; - case 'FRK': - coinlogo = 'franko'; - coinname = 'Franko'; - break; - case 'GAME': - coinlogo = 'GAME'; - coinname = 'GameCredits'; - break; - } + const _coinTitle = getCoinTitle(coin); return { - 'logo': coinlogo, - 'name': coinname + 'logo': _coinTitle.logo, + 'name': _coinTitle.name }; } componentWillReceiveProps(props) { - // console.log('SyncOnly', props); if (props.SyncOnly) { for (let port in this.props.SyncOnly.forks) { const forkInfo = this.props.SyncOnly.forks[port]; @@ -130,7 +51,6 @@ class SyncOnly extends React.Component { forkInfo.getinfo && forkInfo.getinfo.error && forkInfo.getinfo.error === 'bitcoinrpc needs coin that is active') { - console.log('fork add coin required'); let _autoRestartedForks = Object.assign({}, this.state.autoRestartedForks); _autoRestartedForks[port] = true; @@ -138,14 +58,15 @@ class SyncOnly extends React.Component { autoRestartedForks: _autoRestartedForks, }); Store.dispatch(addCoin(forkInfo.registry.coin, '1', null, port)); - setTimeout(function() { + + setTimeout(() => { let _autoRestartedForks = Object.assign({}, this.state.autoRestartedForks); _autoRestartedForks[port] = false; this.setState({ autoRestartedForks: _autoRestartedForks, }); - }.bind(this), 10000); + }, 10000); } } } @@ -238,12 +159,14 @@ class SyncOnly extends React.Component {
{ Full
{ this.renderCoinName(forkInfo.registry.coin).name } ({ forkInfo.registry.coin.toUpperCase() })
- this._stopIguanaFork(forkInfo.registry.pmid) }> + this._stopIguanaFork(forkInfo.registry.pmid) }> { translate('INDEX.STOP') }
- +
diff --git a/react/src/components/dashboard/walletsBalance.js b/react/src/components/dashboard/walletsBalance.js index 5110aff..d0f7435 100755 --- a/react/src/components/dashboard/walletsBalance.js +++ b/react/src/components/dashboard/walletsBalance.js @@ -30,7 +30,7 @@ class WalletsBalance extends React.Component { this.props.ActiveCoin.mode === 'basilisk' && this.props.ActiveCoin.activeAddress && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin] && - this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress]&& + this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress] && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance.data && this.props.ActiveCoin.cache[this.props.ActiveCoin.coin][this.props.ActiveCoin.activeAddress].getbalance.data.balance) { diff --git a/react/src/components/dashboard/walletsBasiliskConnection.js b/react/src/components/dashboard/walletsBasiliskConnection.js index 3e67a0b..c9d6eb8 100755 --- a/react/src/components/dashboard/walletsBasiliskConnection.js +++ b/react/src/components/dashboard/walletsBasiliskConnection.js @@ -76,13 +76,13 @@ class WalletsBasiliskConnection extends React.Component {
- { translate('IAPI.CON_STATUS') + '... ' + this.props.Dashboard.connectedNotaries.current + '/' + this.props.Dashboard.connectedNotaries.total + ': ' + this.props.Dashboard.connectedNotaries.currentNodeName} { Math.floor(this.props.Dashboard.connectedNotaries.current * 100 / this.props.Dashboard.connectedNotaries.total) }% + { `${translate('IAPI.CON_STATUS')}... ${this.props.Dashboard.connectedNotaries.current}/${this.props.Dashboard.connectedNotaries.total}:${this.props.Dashboard.connectedNotaries.currentNodeName}` } { Math.floor(this.props.Dashboard.connectedNotaries.current * 100 / this.props.Dashboard.connectedNotaries.total) }%
-                  { this.props.Dashboard.connectedNotaries.failedToConnectNodes ? 'Failed: ' + this.props.Dashboard.connectedNotaries.failedToConnectNodes : null }
+                  { this.props.Dashboard.connectedNotaries.failedToConnectNodes ? `Failed: ${this.props.Dashboard.connectedNotaries.failedToConnectNodes}` : null }
                   
diff --git a/react/src/components/dashboard/walletsData.js b/react/src/components/dashboard/walletsData.js index 592960c..1b551ad 100644 --- a/react/src/components/dashboard/walletsData.js +++ b/react/src/components/dashboard/walletsData.js @@ -82,6 +82,7 @@ class WalletsData extends React.Component { } } + // deprecated toggleCacheApi() { const _useCache = !this.state.useCache; @@ -463,6 +464,7 @@ class WalletsData extends React.Component { } }*/ + // deprecated renderUseCacheToggle() { if (this.props.ActiveCoin.mode === 'basilisk') { return ( @@ -548,11 +550,11 @@ class WalletsData extends React.Component { this.props.Dashboard.activeHandle[this.props.ActiveCoin.coin] && this.props.ActiveCoin.mode === 'basilisk') { return ( -
+
-
+
+ style={{ backgroundImage: `url("assets/images/bg/${this.props.activeSection}_transparent_header_bg.png")`, backgroundRepeat: 'no-repeat', backgroundPosition: '0%' }}>

EasyDEX

  1. { translate('INDEX.DASHBOARD') }
  2. diff --git a/react/src/components/dashboard/walletsNative.js b/react/src/components/dashboard/walletsNative.js index 9951832..1e2d5ef 100644 --- a/react/src/components/dashboard/walletsNative.js +++ b/react/src/components/dashboard/walletsNative.js @@ -29,10 +29,10 @@ class WalletsNative extends React.Component { return (
    -
    +
    1. - { this.props.ActiveCoin.coin } + { this.props.ActiveCoin.coin }
    diff --git a/react/src/components/dashboard/walletsNativeSend.js b/react/src/components/dashboard/walletsNativeSend.js index 69884ef..52e3e00 100644 --- a/react/src/components/dashboard/walletsNativeSend.js +++ b/react/src/components/dashboard/walletsNativeSend.js @@ -80,7 +80,7 @@ class WalletsNativeSend extends React.Component { renderAddressList() { return ( -
    +
    - + +
    ); diff --git a/react/src/components/main/main.js b/react/src/components/main/main.js index 9eebbd9..461ae17 100644 --- a/react/src/components/main/main.js +++ b/react/src/components/main/main.js @@ -8,6 +8,8 @@ import { iguanaActiveHandle } from '../../actions/actionCreators'; +const IGUANA_ACTIVE_HANDLE_TIMEOUT = 30000; + class Main extends React.Component { constructor(props) { super(props); @@ -24,7 +26,7 @@ class Main extends React.Component { Store.dispatch(iguanaActiveHandle()); const _iguanaActiveHandle = setInterval(function() { Store.dispatch(iguanaActiveHandle()); - }, 30000); + }, IGUANA_ACTIVE_HANDLE_TIMEOUT); this.setState(Object.assign({}, this.state, { activeHandleInterval: _iguanaActiveHandle,