From dbddf5110ae16c106802b962a0726ce0150a7fda Mon Sep 17 00:00:00 2001 From: pbca26 <pbca26@gmail.com> Date: Wed, 2 Aug 2017 20:06:26 +0300 Subject: [PATCH] disable log store update in prod --- react/src/actions/actions/addCoin.js | 42 ++-- react/src/actions/actions/addressBalance.js | 182 ++++++++++-------- react/src/actions/actions/atomic.js | 42 ++-- .../actions/actions/basiliskProcessAddress.js | 84 ++++---- react/src/actions/actions/createWallet.js | 42 ++-- react/src/actions/actions/dexCoins.js | 42 ++-- react/src/actions/actions/edexBalance.js | 72 ++++--- react/src/actions/actions/edexGetTx.js | 42 ++-- react/src/actions/actions/fullTxHistory.js | 42 ++-- react/src/actions/actions/getAddrByAccount.js | 42 ++-- react/src/actions/actions/iguanaHelpers.js | 42 ++-- react/src/actions/actions/logout.js | 42 ++-- react/src/actions/actions/nativeBalance.js | 42 ++-- react/src/actions/actions/nativeNewAddress.js | 42 ++-- react/src/actions/actions/nativeSend.js | 84 ++++---- react/src/actions/actions/nativeSyncInfo.js | 84 ++++---- react/src/actions/actions/nativeTxHistory.js | 42 ++-- react/src/actions/actions/notary.js | 84 ++++---- react/src/actions/actions/sendFullBasilisk.js | 168 +++++++++------- react/src/actions/actions/settings.js | 126 ++++++------ react/src/actions/actions/syncInfo.js | 42 ++-- react/src/actions/actions/walletAuth.js | 168 +++++++++------- 22 files changed, 913 insertions(+), 685 deletions(-) diff --git a/react/src/actions/actions/addCoin.js b/react/src/actions/actions/addCoin.js index bd11ef1..c34443b 100644 --- a/react/src/actions/actions/addCoin.js +++ b/react/src/actions/actions/addCoin.js @@ -97,14 +97,16 @@ export function addCoin(coin, mode, syncOnly, port, startupParams) { export function iguanaAddCoin(coin, mode, acData, port) { function _iguanaAddCoin(dispatch) { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'iguanaAddCoin', - 'type': 'post', - 'url': `http://127.0.0.1:${(port ? port : Config.iguanaCorePort)}`, - 'payload': acData, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'iguanaAddCoin', + 'type': 'post', + 'url': `http://127.0.0.1:${(port ? port : Config.iguanaCorePort)}`, + 'payload': acData, + 'status': 'pending', + })); + } return fetch(`http://127.0.0.1:${(port ? port : Config.iguanaCorePort)}`, { method: 'POST', @@ -112,11 +114,13 @@ export function iguanaAddCoin(coin, mode, acData, port) { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( translate('TOASTR.FAILED_TO_ADDCOIN'), @@ -127,11 +131,13 @@ export function iguanaAddCoin(coin, mode, acData, port) { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } dispatch( addCoinResult( coin, diff --git a/react/src/actions/actions/addressBalance.js b/react/src/actions/actions/addressBalance.js index e0acd18..a420575 100644 --- a/react/src/actions/actions/addressBalance.js +++ b/react/src/actions/actions/addressBalance.js @@ -106,14 +106,16 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { } const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'getKMDAddressesNative', - 'type': 'post', - 'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'getKMDAddressesNative', + 'type': 'post', + 'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } let _fetchConfig = { method: 'POST', @@ -137,11 +139,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { ) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'getKMDAddressesNative', @@ -152,11 +156,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } resolve(Config.cli.default && mode === 'native' ? json.result : json); }) } @@ -279,7 +285,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { Promise.all(result[1].map((_address, index) => { return new Promise((resolve, reject) => { const _timestamp = Date.now(); - let ajaxDataToHex = `[\"${_address}\"]`; + let ajaxDataToHex = '["' + _address + '"]'; iguanaHashHex(ajaxDataToHex, dispatch) .then((hashHexJson) => { @@ -301,14 +307,16 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { 'hex': hashHexJson, }; } - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'getKMDAddressesNative+ZBalance', - 'type': 'post', - 'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'getKMDAddressesNative+ZBalance', + 'type': 'post', + 'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } let _fetchConfig = { method: 'POST', @@ -341,11 +349,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { ) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'getKMDAddressesNative+ZBalance', @@ -359,11 +369,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { if (json && json.error) { resolve(0); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': json, + })); + } dispatch( triggerToaster( 'getKMDAddressesNative+ZBalance', @@ -382,11 +394,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { amount: json, type: 'private', }; - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } } }); }); @@ -435,14 +449,16 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { calcBalance(result, json[coin][currentAddress].refresh.data, dispatch, mode); } else { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'getKMDAddressesNative+Balance', - 'type': 'post', - 'url': `http://127.0.0.1:${(Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'getKMDAddressesNative+Balance', + 'type': 'post', + 'url': `http://127.0.0.1:${(Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}`, + 'payload': payload, + 'status': 'pending', + })); + } fetch(`http://127.0.0.1:${(Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}`, { method: 'POST', @@ -450,11 +466,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'getKMDAddressesNative+Balance', @@ -465,11 +483,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { }) .then(response => response.json()) .then(function(json) { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } updatedCache.basilisk[coin][currentAddress].refresh = { 'data': json, 'status': 'done', @@ -487,14 +507,16 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { }) } else { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'getKMDAddressesNative+Balance', - 'type': 'post', - 'url': `http://127.0.0.1:${(Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'getKMDAddressesNative+Balance', + 'type': 'post', + 'url': `http://127.0.0.1:${(Config.useBasiliskInstance && mode === 'basilisk' ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}`, + 'payload': payload, + 'status': 'pending', + })); + } let _fetchConfig = { method: 'POST', @@ -525,11 +547,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { ) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'getKMDAddressesNative+Balance', @@ -544,11 +568,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { mode === 'native') { json = json.result; } - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } calcBalance( result, json, diff --git a/react/src/actions/actions/atomic.js b/react/src/actions/actions/atomic.js index 8008e73..a6d5b73 100644 --- a/react/src/actions/actions/atomic.js +++ b/react/src/actions/actions/atomic.js @@ -9,14 +9,16 @@ import Config from '../../config'; export function atomic(payload) { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'atomic', - 'type': 'post', - 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'atomic', + 'type': 'post', + 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', @@ -24,11 +26,13 @@ export function atomic(payload) { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( payload.method, @@ -39,11 +43,13 @@ export function atomic(payload) { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } dispatch(atomicState(json)); }); } diff --git a/react/src/actions/actions/basiliskProcessAddress.js b/react/src/actions/actions/basiliskProcessAddress.js index 1a4445b..ec85708 100644 --- a/react/src/actions/actions/basiliskProcessAddress.js +++ b/react/src/actions/actions/basiliskProcessAddress.js @@ -17,14 +17,16 @@ export function checkAddressBasilisk(coin, address) { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'checkAddressBasilisk', - 'type': 'post', - 'url': `http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'checkAddressBasilisk', + 'type': 'post', + 'url': `http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } return fetch(`http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, { method: 'POST', @@ -32,11 +34,13 @@ export function checkAddressBasilisk(coin, address) { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'checkAddressBasilisk', @@ -47,11 +51,13 @@ export function checkAddressBasilisk(coin, address) { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } dispatch(checkAddressBasiliskHandle(json)); }) } @@ -97,14 +103,16 @@ export function validateAddressBasilisk(coin, address) { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'validateAddressBasilisk', - 'type': 'post', - 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'validateAddressBasilisk', + 'type': 'post', + 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } return fetch(`http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, { method: 'POST', @@ -112,11 +120,13 @@ export function validateAddressBasilisk(coin, address) { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'validateAddressBasilisk', @@ -127,11 +137,13 @@ export function validateAddressBasilisk(coin, address) { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } dispatch(validateAddressBasiliskHandle(json)); }) } diff --git a/react/src/actions/actions/createWallet.js b/react/src/actions/actions/createWallet.js index cde4df6..88fc4e2 100644 --- a/react/src/actions/actions/createWallet.js +++ b/react/src/actions/actions/createWallet.js @@ -42,14 +42,16 @@ export function createNewWallet(_passphrase) { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'createNewWallet', - 'type': 'post', - 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'createNewWallet', + 'type': 'post', + 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', @@ -57,11 +59,13 @@ export function createNewWallet(_passphrase) { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'createNewWallet', @@ -72,11 +76,13 @@ export function createNewWallet(_passphrase) { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } dispatch(createNewWalletState(json)); }) } diff --git a/react/src/actions/actions/dexCoins.js b/react/src/actions/actions/dexCoins.js index 8df3a0a..817ba99 100644 --- a/react/src/actions/actions/dexCoins.js +++ b/react/src/actions/actions/dexCoins.js @@ -17,14 +17,16 @@ export function getDexCoins() { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'getDexCoins', - 'type': 'post', - 'url': Config.iguanaLessMode ? `http://127.0.0.1:${Config.agamaPort}/shepherd/InstantDEX/allcoins` : `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': _payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'getDexCoins', + 'type': 'post', + 'url': Config.iguanaLessMode ? `http://127.0.0.1:${Config.agamaPort}/shepherd/InstantDEX/allcoins` : `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': _payload, + 'status': 'pending', + })); + } let _fetchConfig = { method: 'POST', @@ -46,11 +48,13 @@ export function getDexCoins() { ) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'Error getDexCoins', @@ -61,11 +65,13 @@ export function getDexCoins() { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } dispatch(dashboardCoinsState(json)); }); } diff --git a/react/src/actions/actions/edexBalance.js b/react/src/actions/actions/edexBalance.js index f54c622..fcdeb55 100644 --- a/react/src/actions/actions/edexBalance.js +++ b/react/src/actions/actions/edexBalance.js @@ -17,14 +17,16 @@ export function iguanaEdexBalance(coin) { return dispatch => { if (coin) { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'iguanaEdexBalance', - 'type': 'post', - 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': _payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'iguanaEdexBalance', + 'type': 'post', + 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': _payload, + 'status': 'pending', + })); + } return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', @@ -32,11 +34,13 @@ export function iguanaEdexBalance(coin) { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'Error iguanaEdexBalance', @@ -70,14 +74,16 @@ export function getDexBalance(coin, mode, addr) { return new Promise((resolve, reject) => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'getDexBalance', - 'type': 'post', - 'url': `http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'getDexBalance', + 'type': 'post', + 'url': `http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } fetch(`http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, { method: 'POST', @@ -85,11 +91,13 @@ export function getDexBalance(coin, mode, addr) { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'getDexBalance', @@ -101,11 +109,13 @@ export function getDexBalance(coin, mode, addr) { .then(response => response.json()) .then(json => { console.log(json); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } }) resolve(index); diff --git a/react/src/actions/actions/edexGetTx.js b/react/src/actions/actions/edexGetTx.js index aa5b987..c9561cb 100644 --- a/react/src/actions/actions/edexGetTx.js +++ b/react/src/actions/actions/edexGetTx.js @@ -17,14 +17,16 @@ export function edexGetTransaction(data, dispatch) { return new Promise((resolve, reject) => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'edexGetTransaction', - 'type': 'post', - 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'edexGetTransaction', + 'type': 'post', + 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', @@ -32,11 +34,13 @@ export function edexGetTransaction(data, dispatch) { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'edexGetTransaction', @@ -47,11 +51,13 @@ export function edexGetTransaction(data, dispatch) { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } resolve(json); }) }); diff --git a/react/src/actions/actions/fullTxHistory.js b/react/src/actions/actions/fullTxHistory.js index 124696a..64a8523 100644 --- a/react/src/actions/actions/fullTxHistory.js +++ b/react/src/actions/actions/fullTxHistory.js @@ -22,14 +22,16 @@ export function getFullTransactionsList(coin) { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'getFullTransactionsList', - 'type': 'post', - 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'getFullTransactionsList', + 'type': 'post', + 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', @@ -37,11 +39,13 @@ export function getFullTransactionsList(coin) { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'getFullTransactionsList', @@ -52,11 +56,13 @@ export function getFullTransactionsList(coin) { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } dispatch(getNativeTxHistoryState(json)); }) } diff --git a/react/src/actions/actions/getAddrByAccount.js b/react/src/actions/actions/getAddrByAccount.js index 0ef1f52..2759224 100644 --- a/react/src/actions/actions/getAddrByAccount.js +++ b/react/src/actions/actions/getAddrByAccount.js @@ -37,14 +37,16 @@ export function getAddressesByAccount(coin, mode) { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'getAddressesByAccount', - 'type': 'post', - 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'getAddressesByAccount', + 'type': 'post', + 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', @@ -52,11 +54,13 @@ export function getAddressesByAccount(coin, mode) { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch(updateErrosStack('activeHandle')); dispatch( triggerToaster( @@ -68,11 +72,13 @@ export function getAddressesByAccount(coin, mode) { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } dispatch( getAddressesByAccountState( json, diff --git a/react/src/actions/actions/iguanaHelpers.js b/react/src/actions/actions/iguanaHelpers.js index a0eb8a9..bcae9eb 100644 --- a/react/src/actions/actions/iguanaHelpers.js +++ b/react/src/actions/actions/iguanaHelpers.js @@ -30,14 +30,16 @@ export function iguanaHashHex(data, dispatch) { resolve(true); } else { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'iguanaHashHex', - 'type': 'post', - 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'iguanaHashHex', + 'type': 'post', + 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', @@ -45,11 +47,13 @@ export function iguanaHashHex(data, dispatch) { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'iguanaHashHex', @@ -60,11 +64,13 @@ export function iguanaHashHex(data, dispatch) { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } resolve(json.hex); }) } diff --git a/react/src/actions/actions/logout.js b/react/src/actions/actions/logout.js index 63f4783..fe68c3f 100644 --- a/react/src/actions/actions/logout.js +++ b/react/src/actions/actions/logout.js @@ -39,14 +39,16 @@ function walletLock() { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'walletLock', - 'type': 'post', - 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'walletLock', + 'type': 'post', + 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', @@ -54,11 +56,13 @@ function walletLock() { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'walletLock', @@ -69,11 +73,13 @@ function walletLock() { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } dispatch(logoutState(json)); dispatch(logoutResetAppState()); }) diff --git a/react/src/actions/actions/nativeBalance.js b/react/src/actions/actions/nativeBalance.js index 22ebef9..960e00f 100644 --- a/react/src/actions/actions/nativeBalance.js +++ b/react/src/actions/actions/nativeBalance.js @@ -42,14 +42,16 @@ export function getKMDBalanceTotal(coin) { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'getKMDBalanceTotal', - 'type': 'post', - 'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'getKMDBalanceTotal', + 'type': 'post', + 'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } let _fetchConfig = { method: 'POST', @@ -72,11 +74,13 @@ export function getKMDBalanceTotal(coin) { ) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'getKMDBalanceTotal', @@ -87,11 +91,13 @@ export function getKMDBalanceTotal(coin) { }) .then(response => response.json()) .then(function(json) { // TODO: figure out why komodod spits out "parse error" - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } if (json && !json.error) { dispatch(getNativeBalancesState(json)); diff --git a/react/src/actions/actions/nativeNewAddress.js b/react/src/actions/actions/nativeNewAddress.js index d41d213..4bd4088 100644 --- a/react/src/actions/actions/nativeNewAddress.js +++ b/react/src/actions/actions/nativeNewAddress.js @@ -49,14 +49,16 @@ export function getNewKMDAddresses(coin, pubpriv) { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'getNewKMDAddresses', - 'type': 'post', - 'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'getNewKMDAddresses', + 'type': 'post', + 'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } let _fetchConfig = { method: 'POST', @@ -85,11 +87,13 @@ export function getNewKMDAddresses(coin, pubpriv) { ) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'getNewKMDAddresses', @@ -103,11 +107,13 @@ export function getNewKMDAddresses(coin, pubpriv) { if (Config.cli.default) { json = json.result; } - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } dispatch( handleGetNewKMDAddresses( pubpriv, diff --git a/react/src/actions/actions/nativeSend.js b/react/src/actions/actions/nativeSend.js index cde0cfe..0f788c8 100644 --- a/react/src/actions/actions/nativeSend.js +++ b/react/src/actions/actions/nativeSend.js @@ -48,14 +48,16 @@ export function sendNativeTx(coin, _payload) { } const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'sendNativeTx', - 'type': 'post', - 'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'sendNativeTx', + 'type': 'post', + 'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } let _fetchConfig = { method: 'POST', @@ -98,11 +100,13 @@ export function sendNativeTx(coin, _payload) { ) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'sendNativeTx', @@ -116,11 +120,13 @@ export function sendNativeTx(coin, _payload) { return _response; }) .then(function(json) { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } if (json.indexOf('"code":') > -1) { const _message = json.substring( @@ -209,14 +215,16 @@ export function getKMDOPID(opid, coin) { } const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'getKMDOPID', - 'type': 'post', - 'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'getKMDOPID', + 'type': 'post', + 'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } let _fetchConfig = { method: 'POST', @@ -245,11 +253,13 @@ export function getKMDOPID(opid, coin) { ) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'getKMDOPID', @@ -263,11 +273,13 @@ export function getKMDOPID(opid, coin) { if (Config.cli.default) { json = json.result; } - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } dispatch(getKMDOPIDState(json)); }) }) diff --git a/react/src/actions/actions/nativeSyncInfo.js b/react/src/actions/actions/nativeSyncInfo.js index ed7c6cb..8260128 100644 --- a/react/src/actions/actions/nativeSyncInfo.js +++ b/react/src/actions/actions/nativeSyncInfo.js @@ -16,14 +16,16 @@ export function getSyncInfoNativeKMD(skipDebug) { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'getSyncInfoNativeKMD', - 'type': 'post', - 'url': Config.iguanaLessMode ? 'http://kmd.explorer.supernet.org/api/status?q=getInfo' : `http://127.0.0.1:${Config.iguanaCorePort}/api/dex/getinfo?userpass=tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}&symbol=${coin}`, - 'payload': '', - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'getSyncInfoNativeKMD', + 'type': 'post', + 'url': Config.iguanaLessMode ? 'http://kmd.explorer.supernet.org/api/status?q=getInfo' : `http://127.0.0.1:${Config.iguanaCorePort}/api/dex/getinfo?userpass=tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}&symbol=${coin}`, + 'payload': '', + 'status': 'pending', + })); + } return fetch( Config.iguanaLessMode ? 'http://kmd.explorer.supernet.org/api/status?q=getInfo' : `http://127.0.0.1:${Config.iguanaCorePort}/api/dex/getinfo?userpass=tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}&symbol=${coin}`, { @@ -31,11 +33,13 @@ export function getSyncInfoNativeKMD(skipDebug) { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'getSyncInfoNativeKMD', @@ -46,11 +50,13 @@ export function getSyncInfoNativeKMD(skipDebug) { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': Config.iguanaLessMode ? json.info : json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': Config.iguanaLessMode ? json.info : json, + })); + } dispatch(getSyncInfoNativeState({ 'remoteKMDNode': Config.iguanaLessMode ? json.info : json })); }) .then(function() { @@ -104,14 +110,16 @@ export function getSyncInfoNative(coin, skipDebug) { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'getSyncInfo', - 'type': 'post', - 'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'getSyncInfo', + 'type': 'post', + 'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } let _fetchConfig = { method: 'POST', body: JSON.stringify(payload), @@ -133,11 +141,13 @@ export function getSyncInfoNative(coin, skipDebug) { ) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'getSyncInfo', @@ -172,11 +182,13 @@ export function getSyncInfoNative(coin, skipDebug) { dispatch(getDebugLog('komodo', 1)); } - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } dispatch( getSyncInfoNativeState( json, diff --git a/react/src/actions/actions/nativeTxHistory.js b/react/src/actions/actions/nativeTxHistory.js index 2bb72de..6724003 100644 --- a/react/src/actions/actions/nativeTxHistory.js +++ b/react/src/actions/actions/nativeTxHistory.js @@ -33,14 +33,16 @@ export function getNativeTxHistory(coin) { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'getNativeTxHistory', - 'type': 'post', - 'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'getNativeTxHistory', + 'type': 'post', + 'url': Config.cli.default ? `http://127.0.0.1:${Config.agamaPort}/shepherd/cli` : `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } let _fetchConfig = { method: 'POST', @@ -69,11 +71,13 @@ export function getNativeTxHistory(coin) { ) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'getNativeTxHistory', @@ -84,11 +88,13 @@ export function getNativeTxHistory(coin) { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } dispatch(getNativeTxHistoryState(json)); }) } diff --git a/react/src/actions/actions/notary.js b/react/src/actions/actions/notary.js index d51d0ec..10f1c8a 100644 --- a/react/src/actions/actions/notary.js +++ b/react/src/actions/actions/notary.js @@ -23,25 +23,29 @@ function initNotaryNodesConSequence(nodes) { return new Promise((resolve, reject) => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': `initNotaryNodesConSequence+${node}`, - 'type': 'post', - 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': `initNotaryNodesConSequence+${node}`, + 'type': 'post', + 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } fetch(`http://127.0.0.1:${(Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort)}/api/dex/getinfo?userpass=${('tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'))}&symbol=${node}`, { method: 'GET', }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( `getInfoDexNode+${node}`, @@ -52,11 +56,13 @@ function initNotaryNodesConSequence(nodes) { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } dispatch( updateNotaryNodeConState( json, @@ -171,25 +177,29 @@ export function getDexNotaries(coin) { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'getDexNotaries', - 'type': 'post', - 'url': `http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'getDexNotaries', + 'type': 'post', + 'url': `http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } return fetch(`http://127.0.0.1:${Config.useBasiliskInstance ? Config.iguanaCorePort + 1 : Config.iguanaCorePort}`, { method: 'POST', body: JSON.stringify(payload), }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'getDexNotaries', @@ -200,11 +210,13 @@ export function getDexNotaries(coin) { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } dispatch(getDexNotariesState(json)); }) } diff --git a/react/src/actions/actions/sendFullBasilisk.js b/react/src/actions/actions/sendFullBasilisk.js index ee058fd..0abda10 100644 --- a/react/src/actions/actions/sendFullBasilisk.js +++ b/react/src/actions/actions/sendFullBasilisk.js @@ -25,14 +25,16 @@ export function sendToAddress(coin, _payload) { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'sendToAddress', - 'type': 'post', - 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'sendToAddress', + 'type': 'post', + 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', @@ -40,11 +42,13 @@ export function sendToAddress(coin, _payload) { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'sendToAddress', @@ -55,11 +59,13 @@ export function sendToAddress(coin, _payload) { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } dispatch(sendToAddressState(json, dispatch)); }) } @@ -81,14 +87,16 @@ export function sendFromAddress(coin, _payload) { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'sendFromAddress', - 'type': 'post', - 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'sendFromAddress', + 'type': 'post', + 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', @@ -96,11 +104,13 @@ export function sendFromAddress(coin, _payload) { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'sendFromAddress', @@ -111,11 +121,13 @@ export function sendFromAddress(coin, _payload) { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } dispatch(sendToAddressState(json, dispatch)); }) } @@ -140,14 +152,16 @@ export function iguanaUTXORawTX(data, dispatch) { return new Promise((resolve, reject) => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'iguanaUTXORawTX', - 'type': 'post', - 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'iguanaUTXORawTX', + 'type': 'post', + 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', @@ -155,11 +169,13 @@ export function iguanaUTXORawTX(data, dispatch) { }) .catch(function(error) { console.log(error); - dispatch => dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch => dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'iguanaUTXORawTX', @@ -170,11 +186,13 @@ export function iguanaUTXORawTX(data, dispatch) { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } resolve(json); }) }); @@ -191,14 +209,16 @@ export function dexSendRawTX(data, dispatch) { return new Promise((resolve, reject) => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'dexSendRawTX', - 'type': 'post', - 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'dexSendRawTX', + 'type': 'post', + 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } fetch('http://127.0.0.1:' + Config.iguanaCorePort, { method: 'POST', @@ -206,11 +226,13 @@ export function dexSendRawTX(data, dispatch) { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'dexSendRawTX', @@ -225,11 +247,13 @@ export function dexSendRawTX(data, dispatch) { return _response; }) .then(function(json) { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } resolve(json); }) }); diff --git a/react/src/actions/actions/settings.js b/react/src/actions/actions/settings.js index 126f10b..f38adfa 100644 --- a/react/src/actions/actions/settings.js +++ b/react/src/actions/actions/settings.js @@ -101,14 +101,16 @@ export function importPrivKey(wifKey) { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'importPrivKey', - 'type': 'post', - 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'importPrivKey', + 'type': 'post', + 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', @@ -116,11 +118,13 @@ export function importPrivKey(wifKey) { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'importPrivKey', @@ -131,11 +135,13 @@ export function importPrivKey(wifKey) { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } dispatch( parseImportPrivKeyResponse( json, @@ -200,14 +206,16 @@ export function getPeersList(coin) { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'getPeersList', - 'type': 'post', - 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'getPeersList', + 'type': 'post', + 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', @@ -215,11 +223,13 @@ export function getPeersList(coin) { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'getPeersList', @@ -230,11 +240,13 @@ export function getPeersList(coin) { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } dispatch(getPeersListState(json, dispatch)); }) } @@ -316,14 +328,16 @@ export function addPeerNode(coin, ip) { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'addPeerNode', - 'type': 'post', - 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'addPeerNode', + 'type': 'post', + 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', @@ -331,11 +345,13 @@ export function addPeerNode(coin, ip) { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'addPeerNode', @@ -346,11 +362,13 @@ export function addPeerNode(coin, ip) { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } dispatch(addPeerNodeState(json, dispatch)); }) } diff --git a/react/src/actions/actions/syncInfo.js b/react/src/actions/actions/syncInfo.js index b24b944..53c87cf 100644 --- a/react/src/actions/actions/syncInfo.js +++ b/react/src/actions/actions/syncInfo.js @@ -31,14 +31,16 @@ export function getSyncInfo(coin) { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'getSyncInfo', - 'type': 'post', - 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'getSyncInfo', + 'type': 'post', + 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', @@ -46,11 +48,13 @@ export function getSyncInfo(coin) { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'getSyncInfo', @@ -65,11 +69,13 @@ export function getSyncInfo(coin) { return _response; }) .then(function(json) { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } if (json.indexOf('coin is busy processing') === -1) { dispatch(getSyncInfoState(json, dispatch)); } diff --git a/react/src/actions/actions/walletAuth.js b/react/src/actions/actions/walletAuth.js index aa5d767..31f2332 100644 --- a/react/src/actions/actions/walletAuth.js +++ b/react/src/actions/actions/walletAuth.js @@ -24,14 +24,16 @@ export function encryptWallet(_passphrase, cb, coin) { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'encryptWallet', - 'type': 'post', - 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'encryptWallet', + 'type': 'post', + 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', @@ -39,11 +41,13 @@ export function encryptWallet(_passphrase, cb, coin) { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'encryptWallet', @@ -55,11 +59,13 @@ export function encryptWallet(_passphrase, cb, coin) { .then(dispatch(walletPassphrase(_passphrase))) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } dispatch( cb.call( this, @@ -82,14 +88,16 @@ export function walletPassphrase(_passphrase) { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'walletpassphrase', - 'type': 'post', - 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'walletpassphrase', + 'type': 'post', + 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': payload, + 'status': 'pending', + })); + } return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', @@ -97,11 +105,13 @@ export function walletPassphrase(_passphrase) { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'walletPassphrase', @@ -111,11 +121,13 @@ export function walletPassphrase(_passphrase) { ); }) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } }) } } @@ -132,14 +144,16 @@ export function iguanaWalletPassphrase(_passphrase) { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'iguanaWalletPassphrase', - 'type': 'post', - 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': _payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'iguanaWalletPassphrase', + 'type': 'post', + 'url': `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': _payload, + 'status': 'pending', + })); + } return fetch(`http://127.0.0.1:${Config.iguanaCorePort}`, { method: 'POST', @@ -147,11 +161,13 @@ export function iguanaWalletPassphrase(_passphrase) { }) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch( triggerToaster( 'Error iguanaWalletPassphrase', @@ -162,11 +178,13 @@ export function iguanaWalletPassphrase(_passphrase) { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } dispatch(iguanaWalletPassphraseState(json, dispatch)); }); } @@ -181,14 +199,16 @@ export function iguanaActiveHandle(getMainAddress) { return dispatch => { const _timestamp = Date.now(); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'function': 'iguanaActiveHandle', - 'type': 'post', - 'url': Config.iguanaLessMode ? `http://127.0.0.1:${Config.agamaPort}/shepherd/SuperNET/activehandle` : `http://127.0.0.1:${Config.iguanaCorePort}`, - 'payload': _payload, - 'status': 'pending', - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'function': 'iguanaActiveHandle', + 'type': 'post', + 'url': Config.iguanaLessMode ? `http://127.0.0.1:${Config.agamaPort}/shepherd/SuperNET/activehandle` : `http://127.0.0.1:${Config.iguanaCorePort}`, + 'payload': _payload, + 'status': 'pending', + })); + } let _fetchConfig = { method: 'POST', @@ -210,11 +230,13 @@ export function iguanaActiveHandle(getMainAddress) { ) .catch(function(error) { console.log(error); - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'error', - 'response': error, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'error', + 'response': error, + })); + } dispatch(updateErrosStack('activeHandle')); dispatch( triggerToaster( @@ -226,11 +248,13 @@ export function iguanaActiveHandle(getMainAddress) { }) .then(response => response.json()) .then(json => { - dispatch(logGuiHttp({ - 'timestamp': _timestamp, - 'status': 'success', - 'response': json, - })); + if (Config.debug) { + dispatch(logGuiHttp({ + 'timestamp': _timestamp, + 'status': 'success', + 'response': json, + })); + } dispatch(getMainAddress ? getMainAddressState(json) : iguanaActiveHandleState(json)); }); }