From 0792bf86bdd67005e7f760d89bd04793d8ce7265 Mon Sep 17 00:00:00 2001 From: pbca26 Date: Thu, 11 May 2017 08:55:44 +0300 Subject: [PATCH 1/7] app config (wip) --- react/src/actions/actionCreators.js | 54 ++++++------ react/src/components/dashboard/navbar.js | 2 +- react/src/components/dashboard/sendCoin.js | 3 +- react/src/components/dashboard/settings.js | 96 ++++++++++++++++++++-- react/src/reducers/settings.js | 18 +++- react/src/util/cacheFormat.js | 4 +- 6 files changed, 142 insertions(+), 35 deletions(-) diff --git a/react/src/actions/actionCreators.js b/react/src/actions/actionCreators.js index af58301..e721fdb 100644 --- a/react/src/actions/actionCreators.js +++ b/react/src/actions/actionCreators.js @@ -53,6 +53,7 @@ export const LOAD_APP_CONFIG = 'LOAD_APP_CONFIG'; export const SAVE_APP_CONFIG = 'SAVE_APP_CONFIG'; export const SERVICE_ERROR = 'SERVICE_ERROR'; export const DASHBOARD_ACTIVE_ADDRESS = 'DASHBOARD_ACTIVE_ADDRESS'; +export const LOAD_APP_INFO = 'LOAD_APP_INFO'; var iguanaForks = {}; // forks in mem array @@ -2493,28 +2494,23 @@ export function edexGetTransaction(data) { }); } -/*export function saveAppConfig() { - const payload = { - 'herdname': target, - 'lastLines': linesCount - }; - +export function saveAppConfig(_payload) { return dispatch => { - return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/debuglog', { + return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/appconf', { method: 'POST', headers: { 'Content-Type': 'application/json', }, - body: JSON.stringify(payload), + body: JSON.stringify(_payload), }) .catch(function(error) { console.log(error); - dispatch(triggerToaster(true, 'getDebugLog', 'Error', 'error')); + dispatch(triggerToaster(true, 'saveAppConfig', 'Error', 'error')); }) .then(response => response.json()) - .then(json => dispatch(getDebugLogState(json))) + .then(json => dispatch(getAppConfigState(json))) } -}*/ +} function getAppConfigState(json) { return { @@ -2622,16 +2618,26 @@ export function shepherdPostCoinList(data) { }); } -/*function Shepherd_SendPendValue() { - Shepherd_SysInfo().then(function(result){ - var ram_data = formatBytes(result.totalmem_bytes) - var pend_val = null; - if (ram_data.size === 'GB') { - if (ram_data.ramsize >= '63' ) { pend_val = 16; } - if (ram_data.ramsize >= '31' ) { pend_val = 8; } - if (ram_data.ramsize >= '15' ) { pend_val = 4; } - if (ram_data.ramsize <= '15' ) { pend_val = 1; } - } else { pend_val = 1; } - sessionStorage.setItem('IguanaPendValue', pend_val); - }) -}*/ \ No newline at end of file +function getAppInfoState(json) { + return { + type: LOAD_APP_INFO, + info: json, + } +} + +export function getAppInfo() { + return dispatch => { + return fetch('http://127.0.0.1:' + Config.agamaPort + '/shepherd/appinfo', { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }) + .catch(function(error) { + console.log(error); + dispatch(triggerToaster(true, 'getAppInfo', 'Error', 'error')); + }) + .then(response => response.json()) + .then(json => dispatch(getAppInfoState(json))) + } +} \ No newline at end of file diff --git a/react/src/components/dashboard/navbar.js b/react/src/components/dashboard/navbar.js index d817180..42e7dea 100644 --- a/react/src/components/dashboard/navbar.js +++ b/react/src/components/dashboard/navbar.js @@ -76,7 +76,7 @@ class Navbar extends React.Component { EasyDEX -
  • +
  • this.dashboardChangeSection('jumblr')}> Jumblr diff --git a/react/src/components/dashboard/sendCoin.js b/react/src/components/dashboard/sendCoin.js index 7cbbbc0..d4c5e22 100644 --- a/react/src/components/dashboard/sendCoin.js +++ b/react/src/components/dashboard/sendCoin.js @@ -288,6 +288,7 @@ class SendCoin extends React.Component { const utxoSet = (refreshData && refreshData.data) || (listunspentData && listunspentData.data); const _pubkey = this.props.Dashboard.activeHandle.pubkey; const forceUpdateCache = this._fetchNewUTXOData; + const _sendFrom = this.state.sendFrom; const sendData = { 'coin': this.props.ActiveCoin.coin, 'sendfrom': this.state.sendFrom, @@ -356,7 +357,7 @@ class SendCoin extends React.Component { getCacheFile(_pubkey) .then(function(result) { console.log('got cache file', result); - let saveThisData = edexRemoveTXID(result.result, txidListToRemove); + let saveThisData = edexRemoveTXID(result.result, _sendFrom, txidListToRemove); console.log('saveThisData', saveThisData); resolve(saveThisData); }); diff --git a/react/src/components/dashboard/settings.js b/react/src/components/dashboard/settings.js index 5ff81a1..0c9c7fb 100644 --- a/react/src/components/dashboard/settings.js +++ b/react/src/components/dashboard/settings.js @@ -8,7 +8,9 @@ import { getDebugLog, getPeersList, addPeerNode, - getAppConfig + getAppConfig, + saveAppConfig, + getAppInfo } from '../../actions/actionCreators'; import Store from '../../store'; import AddCoinOptionsCrypto from '../addcoin/addcoinOptionsCrypto'; @@ -30,6 +32,7 @@ class Settings extends React.Component { debugLinesCount: 10, debugTarget: 'iguana', activeTabHeight: '10px', + appSettings: [], }; this.exportWifKeys = this.exportWifKeys.bind(this); this.updateInput = this.updateInput.bind(this); @@ -44,12 +47,16 @@ class Settings extends React.Component { componentDidMount() { Store.dispatch(iguanaActiveHandle()); Store.dispatch(getAppConfig()); + Store.dispatch(getAppInfo()); + } + + _saveAppConfig() { + Store.dispatch(saveAppConfig); } openTab(elemId, tab) { - console.log(elemId); const _height = document.querySelector('#' + elemId + ' .panel-collapse .panel-body').clientHeight; - console.log(_height); + this.setState(Object.assign({}, this.state, { activeTab: tab, activeTabHeight: _height, @@ -112,6 +119,51 @@ class Settings extends React.Component { } } + renderConfigEditForm() { + console.log(this.props.Settings.appSettings); + let items = []; + const _appConfig = this.props.Settings.appSettings; + + for (let key in this.props.Settings.appSettings) { + if (Object.keys(this.props.Settings.appSettings[key]).length && key !== 'host') { + items.push( + + + {key} + + + + ); + + for (let _key in this.props.Settings.appSettings[key]) { + items.push( + + + {_key} + + + + + + ); + } + } else { + items.push( + + + {key} + + + + + + ); + } + } + + return items; + } + updateInput(e) { this.setState({ [e.target.name]: e.target.value, @@ -393,13 +445,45 @@ class Settings extends React.Component {
    this.openTab('AppSettings', 7)}> - - App Settings (config.json) + + App Config (config.json)
    -

    Manage app settings

    +

    Manage app config

    +

    + Most changes to app config require wallet restart! +

    +
    +
    +
    +
    +
    +
    + + + {this.renderConfigEditForm()} + +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    this.openTab('AppInfo', 8)}> + + App Info + +
    +
    +
    +

    {translate('INDEX.DEBUG_LOG_DESC')}

    diff --git a/react/src/reducers/settings.js b/react/src/reducers/settings.js index d08740b..ca26b76 100644 --- a/react/src/reducers/settings.js +++ b/react/src/reducers/settings.js @@ -1,9 +1,17 @@ -import { GET_WIF_KEY, GET_PEERS_LIST, GET_DEBUG_LOG } from '../actions/actionCreators'; +import { + GET_WIF_KEY, + GET_PEERS_LIST, + GET_DEBUG_LOG, + LOAD_APP_CONFIG, + LOAD_APP_INFO +} from '../actions/actionCreators'; export function Settings(state = { wifkey: null, address: null, debugLog: null, + appSettings: null, + appInfo: null, }, action) { switch (action.type) { case GET_WIF_KEY: @@ -20,6 +28,14 @@ export function Settings(state = { return Object.assign({}, state, { debugLog: action.data, }); + case LOAD_APP_CONFIG: + return Object.assign({}, state, { + appSettings: action.config, + }); + case LOAD_APP_INFO: + return Object.assign({}, state, { + appInfo: action.info, + }); default: return state; } diff --git a/react/src/util/cacheFormat.js b/react/src/util/cacheFormat.js index 0ea9bfb..792d405 100644 --- a/react/src/util/cacheFormat.js +++ b/react/src/util/cacheFormat.js @@ -10,7 +10,7 @@ export function edexGetTxIDList(getTxData) { return getTxidList; } -export function edexRemoveTXID(_obj, txidArray) { +export function edexRemoveTXID(_obj, address, txidArray) { let txidToStr = ':' + txidArray.join(':') + ':'; console.log(txidToStr); @@ -21,7 +21,7 @@ export function edexRemoveTXID(_obj, txidArray) { } else { for (let key in _obj.basilisk) { for (let coinAddr in _obj.basilisk[key]) { - if (_obj.basilisk[key][coinAddr] !== 'addresses') { + if (_obj.basilisk[key][coinAddr] !== 'addresses' && coinAddr === address) { if (_obj.basilisk[key][coinAddr].refresh && _obj.basilisk[key][coinAddr].refresh.data && _obj.basilisk[key][coinAddr].refresh.data.length > 0) { From 50c2f5f8ed9078713c643cc763cc6b34cb244579 Mon Sep 17 00:00:00 2001 From: Petr Balashov Date: Thu, 11 May 2017 14:30:36 +0200 Subject: [PATCH 2/7] app info tab in settings --- react/src/components/dashboard/settings.js | 635 +++++++++++---------- 1 file changed, 341 insertions(+), 294 deletions(-) diff --git a/react/src/components/dashboard/settings.js b/react/src/components/dashboard/settings.js index 0c9c7fb..790a8a1 100644 --- a/react/src/components/dashboard/settings.js +++ b/react/src/components/dashboard/settings.js @@ -103,6 +103,88 @@ class Settings extends React.Component { } } + renderAppInfoTab() { + const releaseInfo = this.props.Settings.appInfo && this.props.Settings.appInfo.releaseInfo; + + if (releaseInfo) { + return ( +
    +
    this.openTab('AppInfo', 8)}> + + App Info + +
    +
    +
    +
    +
    +
    App Release
    +
    + Name: {this.props.Settings.appInfo.releaseInfo.name} +
    +
    + Version: {this.props.Settings.appInfo.releaseInfo.version} +
    +
    +
    +
    +
    +
    System Info
    +
    + Architecture: {this.props.Settings.appInfo.sysInfo.arch} +
    +
    + OS Type: {this.props.Settings.appInfo.sysInfo.os_type} +
    +
    + OS Platfrom: {this.props.Settings.appInfo.sysInfo.platform} +
    +
    + OS Release: {this.props.Settings.appInfo.sysInfo.os_release} +
    +
    + CPU: {this.props.Settings.appInfo.sysInfo.cpu} +
    +
    + CPU Cores: {this.props.Settings.appInfo.sysInfo.cpu_cores} +
    +
    + Memory: {this.props.Settings.appInfo.sysInfo.totalmem_readable} +
    +
    +
    +
    +
    +
    Locations
    +
    + Cache: {this.props.Settings.appInfo.dirs.cacheLocation} +
    +
    + Config: {this.props.Settings.appInfo.dirs.configLocation} +
    +
    + Iguana Bin: {this.props.Settings.appInfo.dirs.iguanaBin} +
    +
    + Iguana Dir: {this.props.Settings.appInfo.dirs.iguanaDir} +
    +
    + Komodo Bin: {this.props.Settings.appInfo.dirs.komododBin} +
    +
    + Komodo Dir: {this.props.Settings.appInfo.dirs.komodoDir} +
    +
    +
    +
    +
    +
    + ); + } else { + return null; + } + } + renderSNPeersList() { if (this.state.getPeersCoin) { const coin = this.state.getPeersCoin.split('|')[0]; @@ -176,344 +258,309 @@ class Settings extends React.Component {
    -
    -
    -

    {translate('INDEX.WALLET_SETTINGS')}

    -
    -
    -
    this.openTab('WalletInfo', 0)}> - - {translate('INDEX.WALLET_INFO')} - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {translate('INDEX.KEY')}{translate('INDEX.VALUE')}
    pubkey -
    {this.props.Main.activeHandle.pubkey}
    -
    btcpubkey -
    {this.props.Main.activeHandle.btcpubkey}
    -
    rmd160 -
    {this.props.Main.activeHandle.rmd160}
    -
    NXT -
    {this.props.Main.activeHandle.NXT}
    -
    notary -
    {this.props.Main.activeHandle.notary}
    -
    status -
    {this.props.Main.activeHandle.status}
    -
    -
    +
    +
    +

    {translate('INDEX.WALLET_SETTINGS')}

    +
    +
    +
    this.openTab('WalletInfo', 0)}> + + {translate('INDEX.WALLET_INFO')} + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {translate('INDEX.KEY')}{translate('INDEX.VALUE')}
    pubkey +
    {this.props.Main.activeHandle.pubkey}
    +
    btcpubkey +
    {this.props.Main.activeHandle.btcpubkey}
    +
    rmd160 +
    {this.props.Main.activeHandle.rmd160}
    +
    NXT +
    {this.props.Main.activeHandle.NXT}
    +
    notary +
    {this.props.Main.activeHandle.notary}
    +
    status +
    {this.props.Main.activeHandle.status}
    +
    +
    -
    -
    this.openTab('AddNodeforCoin', 1)}> - - {translate('INDEX.ADD_NODE')} - -
    -
    -
    -
    -
    -
    -

    {translate('INDEX.USE_THIS_SECTION')}

    -
    -
    -
    - -
    -
    -
    - -
    -
    -
    - SuperNET Peers: -
    -

    {this.renderSNPeersList()}

    -
    - Raw Peers: -
    -

    {this.renderPeersList()}

    +
    +
    this.openTab('AddNodeforCoin', 1)}> + + {translate('INDEX.ADD_NODE')} + +
    +
    +
    +
    +
    +
    +

    {translate('INDEX.USE_THIS_SECTION')}

    +
    +
    +
    +
    +
    + +
    +
    +
    + SuperNET Peers: +
    +

    {this.renderSNPeersList()}

    +
    + Raw Peers: +
    +

    {this.renderPeersList()}

    +
    +
    -
    -
    -

    {translate('INDEX.USE_THIS_SECTION_PEER')}

    -
    -
    -
    - -
    -
    - -
    +
    +
    +

    {translate('INDEX.USE_THIS_SECTION_PEER')}

    +
    +
    +
    +
    -
    - +
    +
    +
    + +
    +
    -
    -
    this.openTab('DumpWallet', 2)}> - - {translate('INDEX.WALLET_BACKUP')} - -
    -
    -
    Wallet Backup section to be updated soon.
    -
    +
    +
    this.openTab('DumpWallet', 2)}> + + {translate('INDEX.WALLET_BACKUP')} + +
    +
    +
    Wallet Backup section to be updated soon.
    +
    -
    -
    this.openTab('FiatCurrencySettings', 3)}> - - {translate('INDEX.FIAT_CURRENCY')} - -
    -
    -
    Fiat currency settings section to be updated soon.
    -
    +
    +
    this.openTab('FiatCurrencySettings', 3)}> + + {translate('INDEX.FIAT_CURRENCY')} + +
    +
    +
    Fiat currency settings section to be updated soon.
    +
    -
    -
    this.openTab('ExportKeys', 4)}> - - {translate('INDEX.EXPORT_KEYS')} - -
    -
    -
    -

    -

    {translate('INDEX.ONLY_ACTIVE_WIF_KEYS')}

    - - {translate('INDEX.PLEASE_KEEP_KEYS_SAFE')} - -

    -
    - -
    - - -
    -
    - -
    - +
    +
    this.openTab('ExportKeys', 4)}> + + {translate('INDEX.EXPORT_KEYS')} + +
    +
    +
    +

    +

    {translate('INDEX.ONLY_ACTIVE_WIF_KEYS')}

    + + {translate('INDEX.PLEASE_KEEP_KEYS_SAFE')} + +

    +
    +
    +
    + + +
    +
    + +
    +
    -
    -
    - - - - - - - - - -
    - {this.props.ActiveCoin.coin} - {this.props.Settings.address}
    - {this.props.ActiveCoin.coin}Wif - {this.props.Settings.wifkey}
    -
    +
    +
    + + + + + + + + + +
    + {this.props.ActiveCoin.coin} + {this.props.Settings.address}
    + {this.props.ActiveCoin.coin}Wif + {this.props.Settings.wifkey}
    +
    -
    -
    this.openTab('ImportKeys', 5)}> - - {translate('INDEX.IMPORT_KEYS')} - -
    -
    -
    -

    -

    {translate('INDEX.IMPORT_KEYS_DESC_P1')}

    -
    {translate('INDEX.IMPORT_KEYS_DESC_P2')}

    -
    {translate('INDEX.IMPORT_KEYS_DESC_P3')}

    - - {translate('INDEX.PLEASE_KEEP_KEYS_SAFE')} - -

    -
    -
    -
    - - -
    -
    - -
    -
    -
    -
    +
    +
    this.openTab('ImportKeys', 5)}> + + {translate('INDEX.IMPORT_KEYS')} + +
    +
    +
    +

    +

    {translate('INDEX.IMPORT_KEYS_DESC_P1')}

    +
    {translate('INDEX.IMPORT_KEYS_DESC_P2')}

    +
    {translate('INDEX.IMPORT_KEYS_DESC_P3')}

    + + {translate('INDEX.PLEASE_KEEP_KEYS_SAFE')} + +

    +
    +
    +
    + + +
    +
    + +
    +
    +
    +
    -
    +
    -
    -
    this.openTab('DebugLog', 6)}> - - {translate('INDEX.DEBUG_LOG')} - -
    -
    -
    -

    {translate('INDEX.DEBUG_LOG_DESC')}

    -
    -
    -
    - - -
    -
    - - -
    -
    - -
    -
    -
    -
    {this.props.Settings.debugLog}
    -
    -
    -
    -
    +
    +
    this.openTab('DebugLog', 6)}> + + {translate('INDEX.DEBUG_LOG')} + +
    +
    +
    +

    {translate('INDEX.DEBUG_LOG_DESC')}

    +
    +
    +
    + + +
    +
    + +
    +
    + +
    +
    +
    +
    {this.props.Settings.debugLog}
    +
    +
    +
    +
    +
    -
    -
    this.openTab('AppSettings', 7)}> - - App Config (config.json) - -
    -
    -
    -

    Manage app config

    -

    - Most changes to app config require wallet restart! -

    -
    -
    -
    -
    -
    -
    - - - {this.renderConfigEditForm()} - -
    -
    -
    - -
    -
    -
    -
    +
    +
    this.openTab('AppSettings', 7)}> + + App Config (config.json) +
    - -
    -
    this.openTab('AppInfo', 8)}> - - App Info - -
    -
    -
    -

    {translate('INDEX.DEBUG_LOG_DESC')}

    -
    -
    -
    - - -
    -
    - - -
    -
    - -
    -
    -
    -
    {this.props.Settings.debugLog}
    -
    -
    +
    +
    +

    Manage app config

    +

    + Most changes to app config require wallet restart! +

    +
    +
    -
    +
    + + + {this.renderConfigEditForm()} + +
    +
    +
    + +
    +
    + + {this.renderAppInfoTab()}
    +
    From b14d7c47beca5ffa34d2b683c6e62aa4013cadaf Mon Sep 17 00:00:00 2001 From: Petr Balashov Date: Thu, 11 May 2017 17:49:00 +0200 Subject: [PATCH 3/7] cleanup #1 --- react/src/components/addcoin/addcoin.js | 57 ++- react/src/components/dashboard/about.js | 2 +- react/src/components/dashboard/appSettings.js | 39 -- react/src/components/dashboard/atomic.js | 174 ++++++-- react/src/components/dashboard/settings.js | 10 +- .../dashboard/walletsNativeTxHistory.js | 24 +- .../dashboard/walletsNativeTxInfo.js | 29 +- react/src/components/dashboard/walletsNav.js | 12 +- .../dashboard/walletsNotariesList.js | 12 +- .../components/dashboard/walletsProgress.js | 35 +- .../src/components/dashboard/walletsTxInfo.js | 14 +- react/src/components/login/login.js | 23 +- react/src/config.js | 1 + react/src/index.js | 8 +- react/src/reducers/interval.js | 4 +- react/src/reducers/main.js | 6 +- react/src/reducers/syncOnly.js | 5 +- react/src/translate/en.js | 27 +- react/src/translate/translate.js | 10 +- react/src/util/crypto/md5.js | 408 +++++++++--------- react/src/util/edex.js | 30 -- 21 files changed, 538 insertions(+), 392 deletions(-) delete mode 100644 react/src/components/dashboard/appSettings.js delete mode 100644 react/src/util/edex.js diff --git a/react/src/components/addcoin/addcoin.js b/react/src/components/addcoin/addcoin.js index a8b4077..1761764 100644 --- a/react/src/components/addcoin/addcoin.js +++ b/react/src/components/addcoin/addcoin.js @@ -48,7 +48,6 @@ class AddCoin extends React.Component { saveCoinSelection() { shepherdPostCoinList(this.state.coins) .then(function(json) { - console.log(json); this.toggleActionsMenu(); }.bind(this)); } @@ -56,7 +55,6 @@ class AddCoin extends React.Component { loadCoinSelection() { shepherdGetCoinList() .then(function(json) { - console.log(json); this.setState(Object.assign({}, this.state, { coins: json.result, actionsMenu: false, @@ -156,7 +154,11 @@ class AddCoin extends React.Component { } activateCoin() { - Store.dispatch(addCoin(this.state.coins[0].selectedCoin.split('|')[0], this.state.coins[0].mode, this.state.coins[0].syncOnly)); + Store.dispatch(addCoin( + this.state.coins[0].selectedCoin.split('|')[0], + this.state.coins[0].mode, + this.state.coins[0].syncOnly + )); } dismiss() { @@ -182,13 +184,21 @@ class AddCoin extends React.Component { } activateAllCoins() { - Store.dispatch(addCoin(this.state.coins[0].selectedCoin.split('|')[0], this.state.coins[0].mode, this.state.coins[0].syncOnly)); + Store.dispatch(addCoin( + this.state.coins[0].selectedCoin.split('|')[0], + this.state.coins[0].mode, + this.state.coins[0].syncOnly + )); for (let i = 1; i < this.state.coins.length; i++) { const _item = this.state.coins[i]; setTimeout(function() { - Store.dispatch(addCoin(_item.selectedCoin.split('|')[0], _item.mode, _item.syncOnly)); + Store.dispatch(addCoin( + _item.selectedCoin.split('|')[0], + _item.mode, + _item.syncOnly + )); }, 2000 * i); } } @@ -204,7 +214,12 @@ class AddCoin extends React.Component {
    1 ? 'multi' : 'single'} key={'add-coin-' + i}>
    - this.updateSelectedCoin(event, i)}> @@ -213,7 +228,12 @@ class AddCoin extends React.Component {
    1 ? 'hide' : 'col-sm-4'}> - +
    @@ -253,7 +273,7 @@ class AddCoin extends React.Component {
    - +
    ); @@ -265,7 +285,13 @@ class AddCoin extends React.Component { render() { return (
    -
  • - this.updateCurrentPage(i + 1) : null}>{i + 1} + this.updateCurrentPage(i + 1) : null}>{i + 1}
  • ); } @@ -117,18 +119,20 @@ class WalletsNativeTxHistory extends React.Component { } renderPaginationItemsPerPageSelector() { - if (this.props.ActiveCoin.txhistory && this.props.ActiveCoin.txhistory !== 'loading' && this.props.ActiveCoin.txhistory.length > 10) { + if (this.props.ActiveCoin.txhistory && + this.props.ActiveCoin.txhistory !== 'loading' && + this.props.ActiveCoin.txhistory.length > 10) { return (
    ); @@ -138,21 +142,23 @@ class WalletsNativeTxHistory extends React.Component { } renderPagination() { - if (this.props.ActiveCoin.txhistory && this.props.ActiveCoin.txhistory !== 'loading' && this.props.ActiveCoin.txhistory.length > 10) { + if (this.props.ActiveCoin.txhistory && + this.props.ActiveCoin.txhistory !== 'loading' && + this.props.ActiveCoin.txhistory.length > 10) { return (
    -
    Showing {((this.state.activePage - 1) * this.state.itemsPerPage) + 1} to {this.state.activePage * this.state.itemsPerPage} of {this.props.ActiveCoin.txhistory.length} entries
    +
    {translate('INDEX.SHOWING')} {((this.state.activePage - 1) * this.state.itemsPerPage) + 1} {translate('INDEX.TO')} {this.state.activePage * this.state.itemsPerPage} {translate('INDEX.OF')} {this.props.ActiveCoin.txhistory.length} entries
    diff --git a/react/src/components/dashboard/walletsNativeTxInfo.js b/react/src/components/dashboard/walletsNativeTxInfo.js index 6a5476c..a312712 100644 --- a/react/src/components/dashboard/walletsNativeTxInfo.js +++ b/react/src/components/dashboard/walletsNativeTxInfo.js @@ -24,41 +24,44 @@ class WalletsNativeTxInfo extends React.Component { } render() { - if (this.props && this.props.ActiveCoin.showTransactionInfo && this.props.ActiveCoin.nativeActiveSection === 'default' && this.props.ActiveCoin.mode === 'native') { + if (this.props && + this.props.ActiveCoin.showTransactionInfo && + this.props.ActiveCoin.nativeActiveSection === 'default' && + this.props.ActiveCoin.mode === 'native') { const txInfo = this.props.ActiveCoin.txhistory[this.props.ActiveCoin.showTransactionInfoTxIndex]; return (
    -