From f9dba21354b32d0f874920184cb578c16a18d5d0 Mon Sep 17 00:00:00 2001 From: Yogesh Kumar Date: Tue, 13 Jun 2017 14:39:16 +0530 Subject: [PATCH 1/4] Updated the guiLog reducers for faster performance. Also added redux devtools to the store --- react/src/reducers/dashboard.js | 54 ++++++++++++--------------------- react/src/store.js | 11 ++++--- 2 files changed, 26 insertions(+), 39 deletions(-) diff --git a/react/src/reducers/dashboard.js b/react/src/reducers/dashboard.js index ac64a60..b91ef3c 100644 --- a/react/src/reducers/dashboard.js +++ b/react/src/reducers/dashboard.js @@ -13,6 +13,14 @@ import { const HTTP_STACK_MAX_ENTRIES = 150; // limit stack mem length to N records per type +const trimHTTPLogs = (logObject) => { + const logObjectArray = Object.keys(logObject); + if (logObjectArray.length - HTTP_STACK_MAX_ENTRIES === 1) { + delete logObject[logObjectArray.shift()] + } + return logObject; +}; + export function Dashboard(state = { activeSection: 'wallets', activeHandle: null, @@ -70,44 +78,22 @@ export function Dashboard(state = { displayViewCacheModal: action.display, }); case LOG_GUI_HTTP: - let _guiLogState = state.guiLog; - let _guiLogStateTrim = { - error: [], - success: [], - pending: [] - }; + const logState = state.guiLog; + const actionTS = action.timestamp; + let newLogState = {}; - if (_guiLogState[action.timestamp]) { - _guiLogState[action.timestamp].status = action.log.status; - _guiLogState[action.timestamp].response = action.log.response; + if (logState[actionTS]) { + const logItem = { [actionTS]: logState[actionTS] } + logItem[actionTS].status = action.log.status; + logItem[actionTS].response = action.log.response; + newLogState = trimHTTPLogs(Object.assign({}, logState, logItem)); } else { - _guiLogState[action.timestamp] = action.log; - } - - for (let timestamp in _guiLogState) { - if (_guiLogState[timestamp].status === 'error') { - _guiLogStateTrim.error.push(_guiLogState[timestamp]); - } - if (_guiLogState[timestamp].status === 'success') { - _guiLogStateTrim.success.push(_guiLogState[timestamp]); - } - if (_guiLogState[timestamp].status === 'pending') { - _guiLogStateTrim.pending.push(_guiLogState[timestamp]); - } - } - - let _guiLogStateNew = {}; - for (let _key in _guiLogStateTrim) { - if (_guiLogStateTrim[_key].length > HTTP_STACK_MAX_ENTRIES) { - _guiLogStateTrim[_key].shift(); - } - for (let i = 0; i < _guiLogStateTrim[_key].length; i++) { - _guiLogStateNew[_guiLogStateTrim[_key][i].timestamp] = _guiLogStateTrim[_key][i]; - } + const logItem = { [actionTS]: action.log }; + newLogState = trimHTTPLogs(Object.assign({}, logState, logItem)); } - + return Object.assign({}, state, { - guiLog: _guiLogStateNew, + guiLog: newLogState, }); default: return state; diff --git a/react/src/store.js b/react/src/store.js index d44e661..c52836e 100644 --- a/react/src/store.js +++ b/react/src/store.js @@ -14,16 +14,17 @@ const defaultState = { Main: null, }; -const enhancers = compose(window.devToolsExtension ? window.devToolsExtension() : f => f); +// const enhancers = compose(window.devToolsExtension ? window.devToolsExtension() : f => f); +/* eslint-disable no-underscore-dangle */ + +const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; +const enhancers = composeEnhancers(applyMiddleware(thunkMiddleware)); const store = createStore( rootReducer, defaultState, - applyMiddleware( - thunkMiddleware, - loggerMiddleware, - ), enhancers); +/* eslint-enable */ export const history = syncHistoryWithStore(browserHistory, store); From daf549d5c4c861dad2d35e96c0a5288854f86211 Mon Sep 17 00:00:00 2001 From: Yogesh Kumar Date: Tue, 13 Jun 2017 17:10:22 +0530 Subject: [PATCH 2/4] Added loggerMiddleware back --- react/src/store.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react/src/store.js b/react/src/store.js index c52836e..acd567c 100644 --- a/react/src/store.js +++ b/react/src/store.js @@ -19,7 +19,7 @@ const defaultState = { /* eslint-disable no-underscore-dangle */ const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; -const enhancers = composeEnhancers(applyMiddleware(thunkMiddleware)); +const enhancers = composeEnhancers(applyMiddleware(thunkMiddleware, loggerMiddleware)); const store = createStore( rootReducer, defaultState, From 7360aa11f5d2ec076b710bcb334451f420a56ce3 Mon Sep 17 00:00:00 2001 From: Petr Balashov Date: Wed, 14 Jun 2017 16:00:42 +0200 Subject: [PATCH 3/4] fixed code style issues in reducers/dashboard --- react/src/reducers/dashboard.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/react/src/reducers/dashboard.js b/react/src/reducers/dashboard.js index b91ef3c..a57c8a2 100644 --- a/react/src/reducers/dashboard.js +++ b/react/src/reducers/dashboard.js @@ -15,9 +15,11 @@ const HTTP_STACK_MAX_ENTRIES = 150; // limit stack mem length to N records per t const trimHTTPLogs = (logObject) => { const logObjectArray = Object.keys(logObject); + if (logObjectArray.length - HTTP_STACK_MAX_ENTRIES === 1) { - delete logObject[logObjectArray.shift()] + delete logObject[logObjectArray.shift()]; } + return logObject; }; @@ -33,7 +35,7 @@ export function Dashboard(state = { currentNodeName: null, failedToConnectNodes: null, }, - guiLog: {} + guiLog: {}, }, action) { switch (action.type) { case DASHBOARD_SECTION_CHANGE: @@ -83,7 +85,7 @@ export function Dashboard(state = { let newLogState = {}; if (logState[actionTS]) { - const logItem = { [actionTS]: logState[actionTS] } + const logItem = { [actionTS]: logState[actionTS] }; logItem[actionTS].status = action.log.status; logItem[actionTS].response = action.log.response; newLogState = trimHTTPLogs(Object.assign({}, logState, logItem)); From 0e8d8edf971167f7f85cb0a31d0dfb23f214ae95 Mon Sep 17 00:00:00 2001 From: Petr Balashov Date: Fri, 16 Jun 2017 00:14:23 +0200 Subject: [PATCH 4/4] changed code style in components and actions --- react/src/actions/actionCreators.js | 6 +- react/src/actions/actions/addCoin.js | 147 ++++++++- react/src/actions/actions/addressBalance.js | 91 +++-- react/src/actions/actions/atomic.js | 8 +- react/src/actions/actions/basiliskCache.js | 78 ++++- .../actions/actions/basiliskProcessAddress.js | 64 +++- .../src/actions/actions/basiliskTxHistory.js | 8 +- react/src/actions/actions/cli.js | 16 +- react/src/actions/actions/coinList.js | 16 +- react/src/actions/actions/copyAddress.js | 16 +- react/src/actions/actions/createWallet.js | 24 +- react/src/actions/actions/dexCoins.js | 8 +- react/src/actions/actions/edexBalance.js | 16 +- react/src/actions/actions/edexGetTx.js | 8 +- react/src/actions/actions/fullTxHistory.js | 8 +- react/src/actions/actions/getAddrByAccount.js | 16 +- react/src/actions/actions/iguanaHelpers.js | 8 +- react/src/actions/actions/iguanaInstance.js | 24 +- react/src/actions/actions/log.js | 8 +- react/src/actions/actions/logout.js | 8 +- react/src/actions/actions/nativeBalance.js | 8 +- react/src/actions/actions/nativeNewAddress.js | 34 +- react/src/actions/actions/nativeSend.js | 32 +- react/src/actions/actions/nativeSyncInfo.js | 24 +- react/src/actions/actions/nativeTxHistory.js | 8 +- react/src/actions/actions/notary.js | 47 ++- react/src/actions/actions/openAlias.js | 8 +- react/src/actions/actions/sendFullBasilisk.js | 40 ++- react/src/actions/actions/settings.js | 119 ++++++- react/src/actions/actions/syncInfo.js | 8 +- react/src/actions/actions/syncOnly.js | 26 +- react/src/actions/actions/sysInfo.js | 8 +- react/src/actions/actions/walletAuth.js | 48 ++- react/src/components/addcoin/addcoin.js | 65 +++- .../src/components/addcoin/addcoin.render.js | 32 +- .../addcoin/coin-selectors.render.js | 43 ++- .../src/components/dashboard/atomic/atomic.js | 14 +- .../dashboard/atomic/atomic.render.js | 16 +- .../components/dashboard/coinTile/coinTile.js | 6 +- .../dashboard/coinTile/coinTile.render.js | 14 +- .../dashboard/coinTile/coinTileItem.js | 50 ++- .../dashboard/coinTile/coinTileItem.render.js | 8 +- .../dashboard/jumblr/jumblr.render.js | 160 ++++----- .../src/components/dashboard/navbar/navbar.js | 37 ++- .../dashboard/navbar/navbar.render.js | 23 +- .../dashboard/notifications/notifications.js | 9 +- .../notifications/notifications.render.js | 34 +- .../dashboard/receiveCoin/receiveCoin.js | 14 +- .../receiveCoin/receiveCoin.render.js | 42 ++- .../components/dashboard/sendCoin/sendCoin.js | 153 ++++++--- .../dashboard/sendCoin/sendCoin.render.js | 111 +++++-- .../components/dashboard/settings/settings.js | 46 ++- .../dashboard/settings/settings.render.js | 88 +++-- .../components/dashboard/syncOnly/syncOnly.js | 32 +- .../dashboard/syncOnly/syncOnly.render.js | 8 +- .../walletsBalance/walletsBalance.render.js | 17 +- .../walletsBasiliskConnection.render.js | 17 +- .../walletsCacheData/walletsCacheData.js | 36 +- .../walletsCacheData.render.js | 4 +- .../dashboard/walletsData/walletsData.js | 75 ++--- .../walletsData/walletsData.render.js | 10 +- .../walletsHeader/walletsHeader.render.js | 21 +- .../walletsNative/walletsNative.render.js | 10 +- .../walletsNativeAlert.render.js | 4 +- .../walletsNativeBalance.render.js | 28 +- .../walletsNativeInfo.render.js | 58 ++-- .../walletsNativeReceive.js | 28 +- .../walletsNativeReceive.render.js | 24 +- .../walletsNativeSend/walletsNativeSend.js | 51 ++- .../walletsNativeSend.render.js | 28 +- .../walletsNativeSyncProgress.render.js | 4 +- .../walletsNativeTxHistory.js | 28 +- .../walletsNativeTxHistory.render.js | 27 +- .../walletsNativeTxInfo.render.js | 6 +- .../dashboard/walletsNav/walletsNav.js | 18 +- .../dashboard/walletsNav/walletsNav.render.js | 12 +- .../walletsNotariesList.js | 4 +- .../walletsNotariesList.render.js | 24 +- .../walletsProgress/walletsProgress.render.js | 4 +- .../walletsTxInfo/walletsTxInfo.render.js | 4 +- react/src/components/login/login.js | 21 +- react/src/components/login/login.render.js | 33 +- react/src/components/login/login.scss | 25 +- react/src/components/overrides.scss | 312 ++++++++++-------- react/src/components/toaster/toaster-item.js | 4 +- react/src/reducers/toaster.js | 7 +- react/src/translate/translate.js | 7 +- react/src/util/cacheFormat.js | 4 +- react/src/util/copyToClipboard.js | 6 +- react/src/util/time.js | 61 ++-- 90 files changed, 2196 insertions(+), 819 deletions(-) diff --git a/react/src/actions/actionCreators.js b/react/src/actions/actionCreators.js index afad134..c51d237 100644 --- a/react/src/actions/actionCreators.js +++ b/react/src/actions/actionCreators.js @@ -314,7 +314,11 @@ export function setBasiliskMainAddress(json, coin, mode) { } if (mode === 'basilisk') { - getDexBalance(coin, mode, json.result); + getDexBalance( + coin, + mode, + json.result + ); } return { diff --git a/react/src/actions/actions/addCoin.js b/react/src/actions/actions/addCoin.js index 6e19d7d..39e6079 100644 --- a/react/src/actions/actions/addCoin.js +++ b/react/src/actions/actions/addCoin.js @@ -53,18 +53,38 @@ export function addCoin(coin, mode, syncOnly, port) { .then(function(json) { setTimeout(function() { console.log(`started ${coin} / ${modeToValue[mode]} fork`, json); - dispatch(iguanaAddCoin(coin, mode, _acData, json.result)); + dispatch( + iguanaAddCoin( + coin, + mode, + _acData, + json.result + ) + ); }, 2000); }); } } else { if (port) { return dispatch => { - dispatch(iguanaAddCoin(coin, mode, _acData, port)); + dispatch( + iguanaAddCoin( + coin, + mode, + _acData, + port + ) + ); } } else { return dispatch => { - dispatch(iguanaAddCoin(coin, mode, _acData)); + dispatch( + iguanaAddCoin( + coin, + mode, + _acData + ) + ); } } } @@ -95,7 +115,13 @@ export function iguanaAddCoin(coin, mode, acData, port) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster(translate('TOASTR.FAILED_TO_ADDCOIN'), translate('TOASTR.ACCOUNT_NOTIFICATION'), 'error')); + dispatch( + triggerToaster( + translate('TOASTR.FAILED_TO_ADDCOIN'), + translate('TOASTR.ACCOUNT_NOTIFICATION'), + 'error' + ) + ); }) .then(response => response.json()) .then(json => { @@ -104,7 +130,13 @@ export function iguanaAddCoin(coin, mode, acData, port) { 'status': 'success', 'response': json, })); - dispatch(addCoinResult(coin, mode, acData)); + dispatch( + addCoinResult( + coin, + mode, + acData + ) + ); }); } @@ -152,14 +184,31 @@ export function shepherdHerd(coin, mode, path) { } if (checkCoinType(coin) === 'crypto') { - acData = startCrypto(path.result, coin, mode); + acData = startCrypto( + path.result, + coin, + mode + ); } if (checkCoinType(coin) === 'currency_ac') { - acData = startCurrencyAssetChain(path.result, coin, mode); + acData = startCurrencyAssetChain( + path.result, + coin, + mode + ); } if (checkCoinType(coin) === 'ac') { - acData = startAssetChain(path.result, coin, mode); - const supply = startAssetChain(path.result, coin, mode, true); + const supply = startAssetChain( + path.result, + coin, + mode, + true + ); + acData = startAssetChain( + path.result, + coin, + mode + ); herdData.ac_options.push(`-ac_supply=${supply}`); } @@ -176,10 +225,24 @@ export function shepherdHerd(coin, mode, path) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster(translate('FAILED_SHEPHERD_HERD'), translate('TOASTR.SERVICE_NOTIFICATION'), 'error')); + dispatch( + triggerToaster( + translate('FAILED_SHEPHERD_HERD'), + translate('TOASTR.SERVICE_NOTIFICATION'), + 'error' + ) + ); }) .then(response => response.json()) - .then(json => dispatch(iguanaAddCoin(coin, mode, acData))); + .then( + json => dispatch( + iguanaAddCoin( + coin, + mode, + acData + ) + ) + ); } } @@ -191,7 +254,13 @@ export function addCoinResult(coin, mode) { }; return dispatch => { - dispatch(triggerToaster(`${coin} ${translate('TOASTR.STARTED_IN')} ${modeToValue[mode]} ${translate('TOASTR.MODE')}`, translate('TOASTR.COIN_NOTIFICATION'), 'success')); + dispatch( + triggerToaster( + `${coin} ${translate('TOASTR.STARTED_IN')} ${modeToValue[mode]} ${translate('TOASTR.MODE')}`, + translate('TOASTR.COIN_NOTIFICATION'), + 'success' + ) + ); dispatch(toggleAddcoinModal(false, false)); dispatch(getDexCoins()); } @@ -208,10 +277,24 @@ export function _shepherdGetConfig(coin, mode) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('Failed to get mode config', 'Error', 'error')); + dispatch( + triggerToaster( + 'Failed to get mode config', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) - .then(json => dispatch(shepherdHerd(coin, mode, json))); + .then( + json => dispatch( + shepherdHerd( + coin, + mode, + json + ) + ) + ); } } @@ -228,10 +311,24 @@ export function shepherdGetConfig(coin, mode) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('Failed to get KMD config', 'Error', 'error')); + dispatch( + triggerToaster( + 'Failed to get KMD config', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) - .then(json => dispatch(shepherdHerd(coin, mode, json))) + .then( + json => dispatch( + shepherdHerd( + coin, + mode, + json + ) + ) + ) } } else { return dispatch => { @@ -244,10 +341,24 @@ export function shepherdGetConfig(coin, mode) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('Failed to get mode config', 'Error', 'error')); + dispatch( + triggerToaster( + 'Failed to get mode config', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) - .then(json => dispatch(shepherdHerd(coin, mode, json))); + .then( + json => dispatch( + shepherdHerd( + coin, + mode, + json + ) + ) + ); } } } \ No newline at end of file diff --git a/react/src/actions/actions/addressBalance.js b/react/src/actions/actions/addressBalance.js index 843e2d6..6efd174 100644 --- a/react/src/actions/actions/addressBalance.js +++ b/react/src/actions/actions/addressBalance.js @@ -89,7 +89,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('getKMDAddressesNative+addresslist+cache', 'Error', 'error')); + dispatch( + triggerToaster( + 'getKMDAddressesNative+addresslist+cache', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(function(json) { @@ -121,7 +127,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('getKMDAddressesNative', 'Error', 'error')); + dispatch( + triggerToaster( + 'getKMDAddressesNative', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { @@ -205,13 +217,12 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { } } - if (isNewAddr) { - if (allAddrArray[a].substring(0, 2) === 'zc' || - allAddrArray[a].substring(0, 2) === 'zt') { - result[1][result[1].length] = allAddrArray[a]; - } else { - result[0][result[0].length] = allAddrArray[a]; - } + if (isNewAddr && + (allAddrArray[a].substring(0, 2) === 'zc' || + allAddrArray[a].substring(0, 2) === 'zt')) { + result[1][result[1].length] = allAddrArray[a]; + } else { + result[0][result[0].length] = allAddrArray[a]; } } } @@ -235,11 +246,6 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { sum += filteredArray[i]; } - if (sum === 0 && - a === 1) { - - } - newAddressArray[a][b] = { address: result[a][b], amount: currentAddress === result[a][b] || mode === 'native' ? sum : 'N/A', @@ -256,7 +262,8 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { const _timestamp = Date.now(); let ajaxDataToHex = `["${_address}"]`; - iguanaHashHex(ajaxDataToHex, dispatch).then((hashHexJson) => { + iguanaHashHex(ajaxDataToHex, dispatch) + .then((hashHexJson) => { if (getPassthruAgent(coin) === 'iguana') { payload = { 'userpass': `tmpIgRPCUser@${sessionStorage.getItem('IguanaRPCAuth')}`, @@ -296,7 +303,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('getKMDAddressesNative+ZBalance', 'Error', 'error')); + dispatch( + triggerToaster( + 'getKMDAddressesNative+ZBalance', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(function(json) { @@ -308,7 +321,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { 'status': 'error', 'response': json, })); - dispatch(triggerToaster('getKMDAddressesNative+ZBalance', 'Error', 'error')); + dispatch( + triggerToaster( + 'getKMDAddressesNative+ZBalance', + 'Error', + 'error' + ) + ); } else { resolve(json); newAddressArray[1][index] = { @@ -351,7 +370,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('getKMDAddressesNative+addresslist+cache', 'Error', 'error')); + dispatch( + triggerToaster( + 'getKMDAddressesNative+addresslist+cache', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(function(json) { @@ -383,7 +408,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('getKMDAddressesNative+Balance', 'Error', 'error')); + dispatch( + triggerToaster( + 'getKMDAddressesNative+Balance', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(function(json) { @@ -398,7 +429,12 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { 'timestamp': Date.now(), }; dispatch(shepherdGroomPost(pubkey, updatedCache)); - calcBalance(result, json, dispatch, mode); + calcBalance( + result, + json, + dispatch, + mode + ); }) } }) @@ -424,7 +460,13 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('getKMDAddressesNative+Balance', 'Error', 'error')); + dispatch( + triggerToaster( + 'getKMDAddressesNative+Balance', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(function(json) { @@ -433,7 +475,12 @@ export function getKMDAddressesNative(coin, mode, currentAddress) { 'status': 'success', 'response': json, })); - calcBalance(result, json, dispatch, mode); + calcBalance( + result, + json, + dispatch, + mode + ); }) } }) diff --git a/react/src/actions/actions/atomic.js b/react/src/actions/actions/atomic.js index 76a70e0..03f7d01 100644 --- a/react/src/actions/actions/atomic.js +++ b/react/src/actions/actions/atomic.js @@ -31,7 +31,13 @@ export function atomic(payload) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster(payload.method, 'Atomic Explorer error', 'error')); + dispatch( + triggerToaster( + payload.method, + 'Atomic Explorer error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { diff --git a/react/src/actions/actions/basiliskCache.js b/react/src/actions/actions/basiliskCache.js index 84c3c71..da4a18f 100644 --- a/react/src/actions/actions/basiliskCache.js +++ b/react/src/actions/actions/basiliskCache.js @@ -19,10 +19,20 @@ export function deleteCacheFile(_payload) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('deleteCacheFile', 'Error', 'error')) + dispatch( + triggerToaster( + 'deleteCacheFile', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) - .then(json => dispatch(fetchNewCacheData(_payload))); + .then( + json => dispatch( + fetchNewCacheData(_payload) + ) + ); } } @@ -38,7 +48,13 @@ export function getCacheFile(pubkey) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('getCacheFile', 'Error', 'error')) + dispatch( + triggerToaster( + 'getCacheFile', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => resolve(json)) @@ -63,7 +79,13 @@ export function fetchNewCacheData(_payload) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('fetchNewCacheData', 'Error', 'error')); + dispatch( + triggerToaster( + 'fetchNewCacheData', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => console.log(json)) @@ -80,10 +102,24 @@ export function getShepherdCache(pubkey, coin) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('getShepherdCache', 'Error', 'error')); + dispatch( + triggerToaster( + 'getShepherdCache', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) - .then(json => dispatch(getShepherdCacheState(json, pubkey, coin))) + .then( + json => dispatch( + getShepherdCacheState( + json, + pubkey, + coin + ) + ) + ) } } @@ -125,10 +161,20 @@ export function fetchUtxoCache(_payload) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('fetchNewCacheData', 'Error', 'error')); + dispatch( + triggerToaster( + 'fetchNewCacheData', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) - .then(json => dispatch(getShepherdCache(_pubkey))) + .then( + json => dispatch( + getShepherdCache(_pubkey) + ) + ) } } @@ -146,7 +192,13 @@ export function shepherdGroomPost(_filename, _payload) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('shepherdGroomPost', 'Error', 'error')); + dispatch( + triggerToaster( + 'shepherdGroomPost', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => console.log(json)) @@ -167,7 +219,13 @@ export function shepherdGroomPostPromise(_filename, _payload) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('shepherdGroomPostPromise', 'Error', 'error')); + dispatch( + triggerToaster( + 'shepherdGroomPostPromise', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => resolve(json)) diff --git a/react/src/actions/actions/basiliskProcessAddress.js b/react/src/actions/actions/basiliskProcessAddress.js index f628cff..05dd24c 100644 --- a/react/src/actions/actions/basiliskProcessAddress.js +++ b/react/src/actions/actions/basiliskProcessAddress.js @@ -39,7 +39,13 @@ export function checkAddressBasilisk(coin, address) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('checkAddressBasilisk', 'Error', 'error')); + dispatch( + triggerToaster( + 'checkAddressBasilisk', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { @@ -57,7 +63,13 @@ function checkAddressBasiliskHandle(json) { if (json && json.error) { return dispatch => { - dispatch(triggerToaster(json.error, translate('TOASTR.WALLET_NOTIFICATION'), 'error')); + dispatch( + triggerToaster( + json.error, + translate('TOASTR.WALLET_NOTIFICATION'), + 'error' + ) + ); } } @@ -65,7 +77,13 @@ function checkAddressBasiliskHandle(json) { json.coin && json.randipbits) { return dispatch => { - dispatch(triggerToaster('Address already registered', translate('TOASTR.WALLET_NOTIFICATION'), 'warning')); + dispatch( + triggerToaster( + 'Address already registered', + translate('TOASTR.WALLET_NOTIFICATION'), + 'warning' + ) + ); } } } @@ -101,7 +119,13 @@ export function validateAddressBasilisk(coin, address) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('validateAddressBasilisk', 'Error', 'error')); + dispatch( + triggerToaster( + 'validateAddressBasilisk', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { @@ -118,16 +142,40 @@ export function validateAddressBasilisk(coin, address) { function validateAddressBasiliskHandle(json) { return dispatch => { if (json.iswatchonly === true) { - dispatch(triggerToaster(translate('TOASTR.VALIDATION_SUCCESS'), translate('TOASTR.BASILISK_NOTIFICATION'), 'error')); + dispatch( + triggerToaster( + translate('TOASTR.VALIDATION_SUCCESS'), + translate('TOASTR.BASILISK_NOTIFICATION'), + 'error' + ) + ); } if (json.iswatchonly === false) { - dispatch(triggerToaster(translate('TOASTR.ADDR_ISNT_REG'), translate('TOASTR.BASILISK_NOTIFICATION'), 'error')); + dispatch( + triggerToaster( + translate('TOASTR.ADDR_ISNT_REG'), + translate('TOASTR.BASILISK_NOTIFICATION'), + 'error' + ) + ); } if (json.iswatchonly === undefined) { - dispatch(triggerToaster(translate('TOASTR.INVALID_QUERY_ALT'), translate('TOASTR.BASILISK_NOTIFICATION'), 'error')); + dispatch( + triggerToaster( + translate('TOASTR.INVALID_QUERY_ALT'), + translate('TOASTR.BASILISK_NOTIFICATION'), + 'error' + ) + ); } if (json.error === 'less than required responses') { - dispatch(triggerToaster(translate('TOASTR.LESS_RESPONSES_REQ'), translate('TOASTR.BASILISK_NOTIFICATION'), 'error')); + dispatch( + triggerToaster( + translate('TOASTR.LESS_RESPONSES_REQ'), + translate('TOASTR.BASILISK_NOTIFICATION'), + 'error' + ) + ); } } } \ No newline at end of file diff --git a/react/src/actions/actions/basiliskTxHistory.js b/react/src/actions/actions/basiliskTxHistory.js index f68407f..b4c6993 100644 --- a/react/src/actions/actions/basiliskTxHistory.js +++ b/react/src/actions/actions/basiliskTxHistory.js @@ -20,7 +20,13 @@ export function getBasiliskTransactionsList(coin, address) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('getBasiliskTransactionsList+cache', 'Error', 'error')); + dispatch( + triggerToaster( + 'getBasiliskTransactionsList+cache', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(function(json) { diff --git a/react/src/actions/actions/cli.js b/react/src/actions/actions/cli.js index 9f35fe2..05e2769 100644 --- a/react/src/actions/actions/cli.js +++ b/react/src/actions/actions/cli.js @@ -25,7 +25,13 @@ export function shepherdCliPromise(mode, chain, cmd) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('shepherdCli', 'Error', 'error')); + dispatch( + triggerToaster( + 'shepherdCli', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => resolve(json)) @@ -49,7 +55,13 @@ export function shepherdCli(mode, chain, cmd) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('shepherdCli', 'Error', 'error')); + dispatch( + triggerToaster( + 'shepherdCli', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => dispatch(cliResponseState(json))) diff --git a/react/src/actions/actions/coinList.js b/react/src/actions/actions/coinList.js index 4a81a90..7885149 100644 --- a/react/src/actions/actions/coinList.js +++ b/react/src/actions/actions/coinList.js @@ -17,7 +17,13 @@ export function shepherdGetCoinList() { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('shepherdGetCoinList', 'Error', 'error')); + dispatch( + triggerToaster( + 'shepherdGetCoinList', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => resolve(json)) @@ -35,7 +41,13 @@ export function shepherdPostCoinList(data) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('shepherdPostCoinList', 'Error', 'error')); + dispatch( + triggerToaster( + 'shepherdPostCoinList', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => resolve(json)) diff --git a/react/src/actions/actions/copyAddress.js b/react/src/actions/actions/copyAddress.js index 56f374f..328198d 100644 --- a/react/src/actions/actions/copyAddress.js +++ b/react/src/actions/actions/copyAddress.js @@ -7,11 +7,23 @@ export function copyCoinAddress(address) { if (_result) { return dispatch => { - dispatch(triggerToaster(translate('DASHBOARD.ADDR_COPIED'), translate('TOASTR.COIN_NOTIFICATION'), 'success')); + dispatch( + triggerToaster( + translate('DASHBOARD.ADDR_COPIED'), + translate('TOASTR.COIN_NOTIFICATION'), + 'success' + ) + ); } } else { return dispatch => { - dispatch(triggerToaster('Couldn\'t copy address to clipboard', translate('TOASTR.COIN_NOTIFICATION'), 'error')); + dispatch( + triggerToaster( + 'Couldn\'t copy address to clipboard', + translate('TOASTR.COIN_NOTIFICATION'), + 'error' + ) + ); } } } \ No newline at end of file diff --git a/react/src/actions/actions/createWallet.js b/react/src/actions/actions/createWallet.js index 934cba4..b7f9157 100644 --- a/react/src/actions/actions/createWallet.js +++ b/react/src/actions/actions/createWallet.js @@ -13,11 +13,23 @@ function createNewWalletState(json) { json.result && json.result === 'success') { return dispatch => { - dispatch(triggerToaster(translate('TOASTR.WALLET_CREATED_SUCCESFULLY'), translate('TOASTR.ACCOUNT_NOTIFICATION'), 'success')); + dispatch( + triggerToaster( + translate('TOASTR.WALLET_CREATED_SUCCESFULLY'), + translate('TOASTR.ACCOUNT_NOTIFICATION'), + 'success' + ) + ); } } else { return dispatch => { - dispatch(triggerToaster('Couldn\'t create new wallet seed', translate('TOASTR.ACCOUNT_NOTIFICATION'), 'error')); + dispatch( + triggerToaster( + 'Couldn\'t create new wallet seed', + translate('TOASTR.ACCOUNT_NOTIFICATION'), + 'error' + ) + ); } } } @@ -52,7 +64,13 @@ export function createNewWallet(_passphrase) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('createNewWallet', 'Error', 'error')); + dispatch( + triggerToaster( + 'createNewWallet', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { diff --git a/react/src/actions/actions/dexCoins.js b/react/src/actions/actions/dexCoins.js index 52c16f0..95837d2 100644 --- a/react/src/actions/actions/dexCoins.js +++ b/react/src/actions/actions/dexCoins.js @@ -37,7 +37,13 @@ export function getDexCoins() { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('Error getDexCoins', 'Error', 'error')); + dispatch( + triggerToaster( + 'Error getDexCoins', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { diff --git a/react/src/actions/actions/edexBalance.js b/react/src/actions/actions/edexBalance.js index 40c2fc0..8926d8c 100644 --- a/react/src/actions/actions/edexBalance.js +++ b/react/src/actions/actions/edexBalance.js @@ -39,7 +39,13 @@ export function iguanaEdexBalance(coin) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('Error iguanaEdexBalance', 'Error', 'error')); + dispatch( + triggerToaster( + 'Error iguanaEdexBalance', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => dispatch(iguanaEdexBalanceState(json))); @@ -86,7 +92,13 @@ export function getDexBalance(coin, mode, addr) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('getDexBalance', 'Error', 'error')); + dispatch( + triggerToaster( + 'getDexBalance', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { diff --git a/react/src/actions/actions/edexGetTx.js b/react/src/actions/actions/edexGetTx.js index bf19636..2efff6e 100644 --- a/react/src/actions/actions/edexGetTx.js +++ b/react/src/actions/actions/edexGetTx.js @@ -39,7 +39,13 @@ export function edexGetTransaction(data, dispatch) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('edexGetTransaction', 'Error', 'error')); + dispatch( + triggerToaster( + 'edexGetTransaction', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { diff --git a/react/src/actions/actions/fullTxHistory.js b/react/src/actions/actions/fullTxHistory.js index f3d224c..f8914c1 100644 --- a/react/src/actions/actions/fullTxHistory.js +++ b/react/src/actions/actions/fullTxHistory.js @@ -42,7 +42,13 @@ export function getFullTransactionsList(coin) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('getFullTransactionsList', 'Error', 'error')); + dispatch( + triggerToaster( + 'getFullTransactionsList', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { diff --git a/react/src/actions/actions/getAddrByAccount.js b/react/src/actions/actions/getAddrByAccount.js index 828f0d3..3cbda4e 100644 --- a/react/src/actions/actions/getAddrByAccount.js +++ b/react/src/actions/actions/getAddrByAccount.js @@ -61,7 +61,13 @@ export function getAddressesByAccount(coin, mode) { 'response': error, })); dispatch(updateErrosStack('activeHandle')); - dispatch(triggerToaster('getAddressesByAccount', 'Error', 'error')); + dispatch( + triggerToaster( + 'getAddressesByAccount', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { @@ -70,7 +76,13 @@ export function getAddressesByAccount(coin, mode) { 'status': 'success', 'response': json, })); - dispatch(getAddressesByAccountState(json, coin, mode)); + dispatch( + getAddressesByAccountState( + json, + coin, + mode + ) + ); }) } } \ No newline at end of file diff --git a/react/src/actions/actions/iguanaHelpers.js b/react/src/actions/actions/iguanaHelpers.js index 93094ea..f989c3b 100644 --- a/react/src/actions/actions/iguanaHelpers.js +++ b/react/src/actions/actions/iguanaHelpers.js @@ -49,7 +49,13 @@ export function iguanaHashHex(data, dispatch) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('iguanaHashHex', 'Error', 'error')); + dispatch( + triggerToaster( + 'iguanaHashHex', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { diff --git a/react/src/actions/actions/iguanaInstance.js b/react/src/actions/actions/iguanaInstance.js index d5adb93..cacec24 100644 --- a/react/src/actions/actions/iguanaInstance.js +++ b/react/src/actions/actions/iguanaInstance.js @@ -17,7 +17,13 @@ export function restartIguanaInstance(pmid) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('restartIguanaInstance', 'Error', 'error')); + dispatch( + triggerToaster( + 'restartIguanaInstance', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => resolve(json)) @@ -54,7 +60,13 @@ export function startIguanaInstance(mode, coin) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('startIguanaInstance', 'Error', 'error')); + dispatch( + triggerToaster( + 'startIguanaInstance', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => resolve(json)) @@ -71,7 +83,13 @@ export function getIguanaInstancesList() { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('getIguanaInstanceList', 'Error', 'error')); + dispatch( + triggerToaster( + 'getIguanaInstanceList', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => resolve(json)) diff --git a/react/src/actions/actions/log.js b/react/src/actions/actions/log.js index 8891290..bfaca4e 100644 --- a/react/src/actions/actions/log.js +++ b/react/src/actions/actions/log.js @@ -34,7 +34,13 @@ export function getAgamaLog(type) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('getAgamaLog', 'Error', 'error')); + dispatch( + triggerToaster( + 'getAgamaLog', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then() diff --git a/react/src/actions/actions/logout.js b/react/src/actions/actions/logout.js index f421efb..933c869 100644 --- a/react/src/actions/actions/logout.js +++ b/react/src/actions/actions/logout.js @@ -52,7 +52,13 @@ function walletLock() { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('walletLock', 'Error', 'error')); + dispatch( + triggerToaster( + 'walletLock', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { diff --git a/react/src/actions/actions/nativeBalance.js b/react/src/actions/actions/nativeBalance.js index de2c7b1..05dfe32 100644 --- a/react/src/actions/actions/nativeBalance.js +++ b/react/src/actions/actions/nativeBalance.js @@ -54,7 +54,13 @@ export function getKMDBalanceTotal(coin) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('getKMDBalanceTotal', 'Error', 'error')); + dispatch( + triggerToaster( + 'getKMDBalanceTotal', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(function(json) { // TODO: figure out why komodod spits out "parse error" diff --git a/react/src/actions/actions/nativeNewAddress.js b/react/src/actions/actions/nativeNewAddress.js index d278c21..c6ff35a 100644 --- a/react/src/actions/actions/nativeNewAddress.js +++ b/react/src/actions/actions/nativeNewAddress.js @@ -11,7 +11,13 @@ import { } from './log'; function handleGetNewKMDAddresses(pubpriv, coin, dispatch) { - dispatch(triggerToaster(translate('KMD_NATIVE.NEW_ADDR_GENERATED'), translate('TOASTR.WALLET_NOTIFICATION'), 'success')); + dispatch( + triggerToaster( + translate('KMD_NATIVE.NEW_ADDR_GENERATED'), + translate('TOASTR.WALLET_NOTIFICATION'), + 'success' + ) + ); dispatch(getKMDAddressesNative(coin)); return {}; @@ -69,7 +75,13 @@ export function getNewKMDAddresses(coin, pubpriv) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('getNewKMDAddresses', 'Error', 'error')); + dispatch( + triggerToaster( + 'getNewKMDAddresses', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { @@ -78,10 +90,22 @@ export function getNewKMDAddresses(coin, pubpriv) { 'status': 'success', 'response': json, })); - dispatch(handleGetNewKMDAddresses(pubpriv, coin, dispatch)); + dispatch( + handleGetNewKMDAddresses( + pubpriv, + coin, + dispatch + ) + ); }) .catch(function(ex) { - dispatch(handleGetNewKMDAddresses(pubpriv, coin, dispatch)) - }) + dispatch( + handleGetNewKMDAddresses( + pubpriv, + coin, + dispatch + ) + ); + }); } } \ No newline at end of file diff --git a/react/src/actions/actions/nativeSend.js b/react/src/actions/actions/nativeSend.js index 57ab44a..898b15e 100644 --- a/react/src/actions/actions/nativeSend.js +++ b/react/src/actions/actions/nativeSend.js @@ -67,7 +67,13 @@ export function sendNativeTx(coin, _payload) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('sendNativeTx', 'Error', 'error')); + dispatch( + triggerToaster( + 'sendNativeTx', + 'Error', + 'error' + ) + ); }) .then(function(response) { const _response = response.text().then(function(text) { return text; }); @@ -82,9 +88,21 @@ export function sendNativeTx(coin, _payload) { if (json.error && json.error.toString().indexOf('code:') > -1) { - dispatch(triggerToaster('Send failed', translate('TOASTR.WALLET_NOTIFICATION'), 'error')); + dispatch( + triggerToaster( + 'Send failed', + translate('TOASTR.WALLET_NOTIFICATION'), + 'error' + ) + ); } else { - dispatch(triggerToaster(translate('TOASTR.TX_SENT_ALT'), translate('TOASTR.WALLET_NOTIFICATION'), 'success')); + dispatch( + triggerToaster( + translate('TOASTR.TX_SENT_ALT'), + translate('TOASTR.WALLET_NOTIFICATION'), + 'success' + ) + ); } }) }); @@ -158,7 +176,13 @@ export function getKMDOPID(opid, coin) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('getKMDOPID', 'Error', 'error')); + dispatch( + triggerToaster( + 'getKMDOPID', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { diff --git a/react/src/actions/actions/nativeSyncInfo.js b/react/src/actions/actions/nativeSyncInfo.js index 7a4abff..5459798 100644 --- a/react/src/actions/actions/nativeSyncInfo.js +++ b/react/src/actions/actions/nativeSyncInfo.js @@ -34,7 +34,13 @@ export function getSyncInfoNativeKMD(skipDebug) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('getSyncInfoNativeKMD', 'Error', 'error')); + dispatch( + triggerToaster( + 'getSyncInfoNativeKMD', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { @@ -98,7 +104,13 @@ export function getSyncInfoNative(coin, skipDebug) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('getSyncInfo', 'Error', 'error')); + dispatch( + triggerToaster( + 'getSyncInfo', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { @@ -107,7 +119,13 @@ export function getSyncInfoNative(coin, skipDebug) { 'status': 'success', 'response': json, })); - dispatch(getSyncInfoNativeState(json, coin, skipDebug)); + dispatch( + getSyncInfoNativeState( + json, + coin, + skipDebug + ) + ); }) } } \ No newline at end of file diff --git a/react/src/actions/actions/nativeTxHistory.js b/react/src/actions/actions/nativeTxHistory.js index 1708ce2..61896b0 100644 --- a/react/src/actions/actions/nativeTxHistory.js +++ b/react/src/actions/actions/nativeTxHistory.js @@ -53,7 +53,13 @@ export function getNativeTxHistory(coin) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('getNativeTxHistory', 'Error', 'error')); + dispatch( + triggerToaster( + 'getNativeTxHistory', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { diff --git a/react/src/actions/actions/notary.js b/react/src/actions/actions/notary.js index a9ebf87..afef1e8 100644 --- a/react/src/actions/actions/notary.js +++ b/react/src/actions/actions/notary.js @@ -44,7 +44,13 @@ function initNotaryNodesConSequence(nodes) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster(`getInfoDexNode+${node}`, 'Error', 'error')); + dispatch( + triggerToaster( + `getInfoDexNode+${node}`, + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { @@ -53,7 +59,14 @@ function initNotaryNodesConSequence(nodes) { 'status': 'success', 'response': json, })); - dispatch(updateNotaryNodeConState(json, nodes.length, index, node)); + dispatch( + updateNotaryNodeConState( + json, + nodes.length, + index, + node + ) + ); }) }); })); @@ -114,17 +127,33 @@ export function connectNotaries() { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('connectNotaries', 'Error', 'error')); + dispatch( + triggerToaster( + 'connectNotaries', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) - .then(json => dispatch(connectAllNotaryNodes(json, dispatch))) + .then( + json => dispatch( + connectAllNotaryNodes(json, dispatch) + ) + ) } } function getDexNotariesState(json) { if (json.error === 'less than required responses') { return dispatch => { - dispatch(triggerToaster(translate('TOASTR.LESS_RESPONSES_REQ'), translate('TOASTR.BASILISK_NOTIFICATION'), 'error')); + dispatch( + triggerToaster( + translate('TOASTR.LESS_RESPONSES_REQ'), + translate('TOASTR.BASILISK_NOTIFICATION'), + 'error' + ) + ); } } else { return { @@ -163,7 +192,13 @@ export function getDexNotaries(coin) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('getDexNotaries', 'Error', 'error')); + dispatch( + triggerToaster( + 'getDexNotaries', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { diff --git a/react/src/actions/actions/openAlias.js b/react/src/actions/actions/openAlias.js index 3dc2ff3..f7edec3 100644 --- a/react/src/actions/actions/openAlias.js +++ b/react/src/actions/actions/openAlias.js @@ -13,7 +13,13 @@ export function resolveOpenAliasAddress(email) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('resolveOpenAliasAddress', 'Error', 'error')); + dispatch( + triggerToaster( + 'resolveOpenAliasAddress', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => resolve(json)) diff --git a/react/src/actions/actions/sendFullBasilisk.js b/react/src/actions/actions/sendFullBasilisk.js index 8402bcb..f8663fe 100644 --- a/react/src/actions/actions/sendFullBasilisk.js +++ b/react/src/actions/actions/sendFullBasilisk.js @@ -45,7 +45,13 @@ export function sendToAddress(coin, _payload) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('sendToAddress', 'Error', 'error')); + dispatch( + triggerToaster( + 'sendToAddress', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { @@ -95,7 +101,13 @@ export function sendFromAddress(coin, _payload) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('sendFromAddress', 'Error', 'error')); + dispatch( + triggerToaster( + 'sendFromAddress', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { @@ -148,7 +160,13 @@ export function iguanaUTXORawTX(data, dispatch) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('iguanaUTXORawTX', 'Error', 'error')); + dispatch( + triggerToaster( + 'iguanaUTXORawTX', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { @@ -193,7 +211,13 @@ export function dexSendRawTX(data, dispatch) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('dexSendRawTX', 'Error', 'error')); + dispatch( + triggerToaster( + 'dexSendRawTX', + 'Error', + 'error' + ) + ); }) .then(function(response) { const _response = response.text().then(function(text) { return text; }); @@ -221,7 +245,13 @@ function sendToAddressState(json, dispatch) { lastSendToResponse: json, } } else if (json && json.result && json.complete) { - dispatch(triggerToaster(translate('TOASTR.TX_SENT_ALT'), translate('TOASTR.WALLET_NOTIFICATION'), 'success')); + dispatch( + triggerToaster( + translate('TOASTR.TX_SENT_ALT'), + translate('TOASTR.WALLET_NOTIFICATION'), + 'success' + ) + ); return { type: DASHBOARD_ACTIVE_COIN_SENDTO, diff --git a/react/src/actions/actions/settings.js b/react/src/actions/actions/settings.js index 8d80b79..f96a615 100644 --- a/react/src/actions/actions/settings.js +++ b/react/src/actions/actions/settings.js @@ -32,7 +32,13 @@ export function getAppInfo() { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('getAppInfo', 'Error', 'error')); + dispatch( + triggerToaster( + 'getAppInfo', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => dispatch(getAppInfoState(json))) @@ -50,19 +56,37 @@ export function settingsWifkeyState(json, coin) { function parseImportPrivKeyResponse(json, dispatch) { if (json.error === 'illegal privkey') { return dispatch => { - dispatch(triggerToaster('Illegal privkey', translate('TOASTR.SETTINGS_NOTIFICATION'), 'error')); + dispatch( + triggerToaster( + 'Illegal privkey', + translate('TOASTR.SETTINGS_NOTIFICATION'), + 'error' + ) + ); } } if (json.error === 'privkey already in wallet') { return dispatch => { - dispatch(triggerToaster('Privkey already in wallet', translate('TOASTR.SETTINGS_NOTIFICATION'), 'warning')); + dispatch( + triggerToaster( + 'Privkey already in wallet', + translate('TOASTR.SETTINGS_NOTIFICATION'), + 'warning' + ) + ); } } if (json && json.result !== undefined && json.result == 'success') { return dispatch => { - dispatch(triggerToaster(translate('TOASTR.PRIV_KEY_IMPORTED'), translate('TOASTR.SETTINGS_NOTIFICATION'), 'success')); + dispatch( + triggerToaster( + translate('TOASTR.PRIV_KEY_IMPORTED'), + translate('TOASTR.SETTINGS_NOTIFICATION'), + 'success' + ) + ); } } } @@ -99,7 +123,13 @@ export function importPrivKey(wifKey) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('importPrivKey', 'Error', 'error')); + dispatch( + triggerToaster( + 'importPrivKey', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { @@ -108,7 +138,12 @@ export function importPrivKey(wifKey) { 'status': 'success', 'response': json, })); - dispatch(parseImportPrivKeyResponse(json, dispatch)); + dispatch( + parseImportPrivKeyResponse( + json, + dispatch + ) + ); }) .catch(function(ex) { dispatch(parseImportPrivKeyResponse({ @@ -144,7 +179,13 @@ export function getDebugLog(target, linesCount) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('getDebugLog', 'Error', 'error')); + dispatch( + triggerToaster( + 'getDebugLog', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => dispatch(getDebugLogState(json))) @@ -181,7 +222,13 @@ export function getPeersList(coin) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('getPeersList', 'Error', 'error')); + dispatch( + triggerToaster( + 'getPeersList', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { @@ -216,22 +263,46 @@ export function getPeersListState(json) { function addPeerNodeState(json, dispatch) { if (json.error === 'addnode needs active coin, do an addcoin first') { return dispatch => { - dispatch(triggerToaster('Addnode needs active coin', translate('TOASTR.SETTINGS_NOTIFICATION'), 'error')); + dispatch( + triggerToaster( + 'Addnode needs active coin', + translate('TOASTR.SETTINGS_NOTIFICATION'), + 'error' + ) + ); } } if (json.result === 'peer was already connected') { return dispatch => { - dispatch(triggerToaster('Peer was already connected', translate('TOASTR.SETTINGS_NOTIFICATION'), 'warning')); + dispatch( + triggerToaster( + 'Peer was already connected', + translate('TOASTR.SETTINGS_NOTIFICATION'), + 'warning' + ) + ); } } if (json.result === 'addnode connection was already pending') { return dispatch => { - dispatch(triggerToaster('Addnode connection was already pending', translate('TOASTR.SETTINGS_NOTIFICATION'), 'warning')); + dispatch( + triggerToaster( + 'Addnode connection was already pending', + translate('TOASTR.SETTINGS_NOTIFICATION'), + 'warning' + ) + ); } } if (json.result === 'addnode submitted') { return dispatch => { - dispatch(triggerToaster('Peer is added', translate('TOASTR.SETTINGS_NOTIFICATION'), 'success')); + dispatch( + triggerToaster( + 'Peer is added', + translate('TOASTR.SETTINGS_NOTIFICATION'), + 'success' + ) + ); } } } @@ -267,7 +338,13 @@ export function addPeerNode(coin, ip) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('addPeerNode', 'Error', 'error')); + dispatch( + triggerToaster( + 'addPeerNode', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { @@ -292,7 +369,13 @@ export function saveAppConfig(_payload) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('saveAppConfig', 'Error', 'error')); + dispatch( + triggerToaster( + 'saveAppConfig', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => dispatch(getAppConfig())) @@ -316,7 +399,13 @@ export function getAppConfig() { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('getAppConfig', 'Error', 'error')); + dispatch( + triggerToaster( + 'getAppConfig', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => dispatch(getAppConfigState(json))) diff --git a/react/src/actions/actions/syncInfo.js b/react/src/actions/actions/syncInfo.js index a6768c5..6fa7d46 100644 --- a/react/src/actions/actions/syncInfo.js +++ b/react/src/actions/actions/syncInfo.js @@ -53,7 +53,13 @@ export function getSyncInfo(coin) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('getSyncInfo', 'Error', 'error')); + dispatch( + triggerToaster( + 'getSyncInfo', + 'Error', + 'error' + ) + ); }) .then(function(response) { const _response = response.text().then(function(text) { return text; }); diff --git a/react/src/actions/actions/syncOnly.js b/react/src/actions/actions/syncOnly.js index 18f0b5c..371f1f9 100644 --- a/react/src/actions/actions/syncOnly.js +++ b/react/src/actions/actions/syncOnly.js @@ -36,7 +36,13 @@ export function getSyncOnlyForks() { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('getSyncOnlyForks', 'Error', 'error')); + dispatch( + triggerToaster( + 'getSyncOnlyForks', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => dispatch(getSyncOnlyForksState(json))) @@ -53,9 +59,23 @@ export function stopIguanaFork(pmid) { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('stopIguanaFork', 'Error', 'error')); + dispatch( + triggerToaster( + 'stopIguanaFork', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) - .then(json => dispatch(triggerToaster('Iguana instance is stopped', translate('TOASTR.SERVICE_NOTIFICATION'), 'success'))) + .then( + json => dispatch( + triggerToaster( + 'Iguana instance is stopped', + translate('TOASTR.SERVICE_NOTIFICATION'), + 'success' + ) + ) + ) } } \ No newline at end of file diff --git a/react/src/actions/actions/sysInfo.js b/react/src/actions/actions/sysInfo.js index 75068e9..ed8ca05 100644 --- a/react/src/actions/actions/sysInfo.js +++ b/react/src/actions/actions/sysInfo.js @@ -17,7 +17,13 @@ export function shepherdGetSysInfo() { }) .catch(function(error) { console.log(error); - dispatch(triggerToaster('Failed to get sys info', 'Error', 'error')) + dispatch( + triggerToaster( + 'Failed to get sys info', + 'Error', + 'error' + ) + ) }) .then(response => response.json()) .then(json => console.log(json)); diff --git a/react/src/actions/actions/walletAuth.js b/react/src/actions/actions/walletAuth.js index 02db498..fb940b2 100644 --- a/react/src/actions/actions/walletAuth.js +++ b/react/src/actions/actions/walletAuth.js @@ -44,7 +44,13 @@ export function encryptWallet(_passphrase, cb, coin) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('encryptWallet', 'Error', 'error')); + dispatch( + triggerToaster( + 'encryptWallet', + 'Error', + 'error' + ) + ); }) .then(dispatch(walletPassphrase(_passphrase))) .then(response => response.json()) @@ -54,7 +60,13 @@ export function encryptWallet(_passphrase, cb, coin) { 'status': 'success', 'response': json, })); - dispatch(cb.call(this, json, coin)); + dispatch( + cb.call( + this, + json, + coin + ) + ); }); } } @@ -90,7 +102,13 @@ export function walletPassphrase(_passphrase) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('walletPassphrase', 'Error', 'error')); + dispatch( + triggerToaster( + 'walletPassphrase', + 'Error', + 'error' + ) + ); }) .then(json => { dispatch(logGuiHttp({ @@ -134,7 +152,13 @@ export function iguanaWalletPassphrase(_passphrase) { 'status': 'error', 'response': error, })); - dispatch(triggerToaster('Error iguanaWalletPassphrase', 'Error', 'error')); + dispatch( + triggerToaster( + 'Error iguanaWalletPassphrase', + 'Error', + 'error' + ) + ); }) .then(response => response.json()) .then(json => { @@ -178,7 +202,13 @@ export function iguanaActiveHandle(getMainAddress) { 'response': error, })); dispatch(updateErrosStack('activeHandle')); - dispatch(triggerToaster(translate('TOASTR.IGUANA_ARE_YOU_SURE'), translate('TOASTR.SERVICE_NOTIFICATION'), 'error')); + dispatch( + triggerToaster( + translate('TOASTR.IGUANA_ARE_YOU_SURE'), + translate('TOASTR.SERVICE_NOTIFICATION'), + 'error' + ) + ); }) .then(response => response.json()) .then(json => { @@ -194,7 +224,13 @@ export function iguanaActiveHandle(getMainAddress) { function iguanaWalletPassphraseState(json, dispatch) { sessionStorage.setItem('IguanaActiveAccount', JSON.stringify(json)); - dispatch(triggerToaster(translate('TOASTR.LOGIN_SUCCESSFULL'), translate('TOASTR.ACCOUNT_NOTIFICATION'), 'success')); + dispatch( + triggerToaster( + translate('TOASTR.LOGIN_SUCCESSFULL'), + translate('TOASTR.ACCOUNT_NOTIFICATION'), + 'success' + ) + ); dispatch(getMainAddressState(json)); dispatch(iguanaActiveHandleState(json)); diff --git a/react/src/components/addcoin/addcoin.js b/react/src/components/addcoin/addcoin.js index c684408..8ee8614 100644 --- a/react/src/components/addcoin/addcoin.js +++ b/react/src/components/addcoin/addcoin.js @@ -50,9 +50,9 @@ class AddCoin extends React.Component { saveCoinSelection() { shepherdPostCoinList(this.state.coins) - .then(function(json) { + .then((json) => { this.toggleActionsMenu(); - }.bind(this)); + }); } loadCoinSelection() { @@ -64,7 +64,13 @@ class AddCoin extends React.Component { actionsMenu: false, })); } else { - Store.dispatch(triggerToaster(translate('TOASTR.SELECTION_NOT_FOUND'), translate('TOASTR.COIN_SELECTION'), 'info')); + Store.dispatch( + triggerToaster( + translate('TOASTR.SELECTION_NOT_FOUND'), + translate('TOASTR.COIN_SELECTION'), + 'info' + ) + ); } }.bind(this)); } @@ -92,9 +98,12 @@ class AddCoin extends React.Component { } componentWillReceiveProps(props) { - this.existingCoins = props && props.Main ? props.Main.coins : null; const addCoinProps = props ? props.AddCoin : null; - if (addCoinProps && addCoinProps.display !== this.state.display) { + + this.existingCoins = props && props.Main ? props.Main.coins : null; + + if (addCoinProps && + addCoinProps.display !== this.state.display) { this.setState(Object.assign({}, this.state, { display: addCoinProps.display, modalClassName: addCoinProps.display ? 'show fade' : 'show fade', @@ -222,11 +231,13 @@ class AddCoin extends React.Component { activateAllCoins() { const coin = this.state.coins[0].selectedCoin.split('|')[0]; if (!this.isCoinAlreadyAdded(coin)) { - Store.dispatch(addCoin( - coin, - this.state.coins[0].mode, - this.state.coins[0].syncOnly - )); + Store.dispatch( + addCoin( + coin, + this.state.coins[0].mode, + this.state.coins[0].syncOnly + ) + ); } for (let i = 1; i < this.state.coins.length; i++) { @@ -235,11 +246,13 @@ class AddCoin extends React.Component { setTimeout(() => { if (!this.isCoinAlreadyAdded(itemCoin)) { - Store.dispatch(addCoin( - itemCoin, - _item.mode, - _item.syncOnly - )); + Store.dispatch( + addCoin( + itemCoin, + _item.mode, + _item.syncOnly + ) + ); } if (i === this.state.coins.length - 1) { @@ -264,7 +277,12 @@ class AddCoin extends React.Component { const _coin = _item.selectedCoin || ''; items.push( - CoinSelectorsRender.call(this, _item, _coin, i) + CoinSelectorsRender.call( + this, + _item, + _coin, + i + ) ); } @@ -278,12 +296,23 @@ class AddCoin extends React.Component { } isCoinAlreadyAdded(coin) { - const modes = ['basilisk', 'full', 'native']; + const modes = [ + 'basilisk', + 'full', + 'native' + ]; for (let mode of modes) { if (this.existingCoins[mode].indexOf(coin) !== -1) { const message = `${coin} ${translate('ADD_COIN.ALREADY_ADDED')} ${translate('ADD_COIN.IN')} ${mode} ${translate('ADD_COIN.MODE')}`; - Store.dispatch(triggerToaster(message, translate('ADD_COIN.COIN_ALREADY_ADDED'), 'error')); + + Store.dispatch( + triggerToaster( + message, + translate('ADD_COIN.COIN_ALREADY_ADDED'), + 'error' + ) + ); return true; } } diff --git a/react/src/components/addcoin/addcoin.render.js b/react/src/components/addcoin/addcoin.render.js index 42fc8b8..ba6b02d 100644 --- a/react/src/components/addcoin/addcoin.render.js +++ b/react/src/components/addcoin/addcoin.render.js @@ -14,7 +14,9 @@ const AddCoinRender = function() { onClick={ this.dismiss }> × -

{ translate('INDEX.SELECT_A_COIN') }

+

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

+ onClick={ this.saveCoinSelection }> + { translate('ADD_COIN.SAVE_SELECTION') } + + onClick={ this.loadCoinSelection }> + { translate('ADD_COIN.LOAD_SELECTION') } + { this.renderCoinSelectors() } -
+
+ onClick={ this.activateAllCoins }> + { translate('ADD_COIN.ACTIVATE_ALL') } +

@@ -49,13 +56,20 @@ const AddCoinRender = function() { { translate('INDEX.BASILISK_MODE') }: { translate('INDEX.BASILISK_MODE_DESC') }

- { translate('INDEX.NATIVE_MODE') }: { translate('INDEX.NATIVE_MODE_DESC1') } Komodo Daemon { translate('INDEX.NATIVE_MODE_DESC2') } Iguana Daemon { translate('INDEX.NATIVE_MODE_DESC3') }. + { translate('INDEX.NATIVE_MODE') }: { translate('INDEX.NATIVE_MODE_DESC1') } + Komodo Daemon { translate('INDEX.NATIVE_MODE_DESC2') } + Iguana Daemon { translate('INDEX.NATIVE_MODE_DESC3') }.

- - { translate('INDEX.NATIVE_MODE') } { translate('INDEX.NATIVE_MODE_DESC4') } { translate('INDEX.NATIVE_MODE_DESC5') }, { translate('INDEX.NATIVE_MODE_DESC5') }. + + { translate('INDEX.NATIVE_MODE') } { translate('INDEX.NATIVE_MODE_DESC4') } + { translate('INDEX.NATIVE_MODE_DESC5') }, + { translate('INDEX.NATIVE_MODE_DESC5') }.
diff --git a/react/src/components/addcoin/coin-selectors.render.js b/react/src/components/addcoin/coin-selectors.render.js index 15aec3d..4acf48d 100644 --- a/react/src/components/addcoin/coin-selectors.render.js +++ b/react/src/components/addcoin/coin-selectors.render.js @@ -4,7 +4,6 @@ import AddCoinOptionsCrypto from '../addcoin/addcoinOptionsCrypto'; import AddCoinOptionsAC from '../addcoin/addcoinOptionsAC'; import AddCoinOptionsACFiat from '../addcoin/addcoinOptionsACFiat'; - const CoinSelectorsRender = function(item, coin, i) { return (
this.activateCoin(i) } - disabled={ item.mode === -2 }>{ translate('INDEX.ACTIVATE_COIN') } + disabled={ item.mode === -2 }> + { translate('INDEX.ACTIVATE_COIN') } +
@@ -50,13 +51,17 @@ const CoinSelectorsRender = function(item, coin, i) { style={{ display: item.fullMode.checked ? 'none' : 'inline-block' }}> { translate('INDEX.FULL_MODE') } + style={{ display: item.fullMode.checked ? 'none' : 'inline-block' }}> + { translate('INDEX.FULL_MODE') } + { translate('INDEX.FULL_MODE') } + style={{ display: item.fullMode.checked ? 'inline-block' : 'none' }}> + { translate('INDEX.FULL_MODE') } +
@@ -76,13 +81,17 @@ const CoinSelectorsRender = function(item, coin, i) { style={{ display: item.basiliskMode.checked ? 'none' : 'inline-block' }}> { translate('INDEX.BASILISK_MODE') } + style={{ display: item.basiliskMode.checked ? 'none' : 'inline-block' }}> + { translate('INDEX.BASILISK_MODE') } + { translate('INDEX.BASILISK_MODE') } + style={{ display: item.basiliskMode.checked ? 'inline-block' : 'none' }}> + { translate('INDEX.BASILISK_MODE') } +
@@ -102,13 +111,17 @@ const CoinSelectorsRender = function(item, coin, i) { style={{ display: item.nativeMode.checked ? 'none' : 'inline-block' }}> { translate('INDEX.NATIVE_MODE') } + style={{ display: item.nativeMode.checked ? 'none' : 'inline-block' }}> + { translate('INDEX.NATIVE_MODE') } + { translate('INDEX.NATIVE_MODE') } + style={{ display: item.nativeMode.checked ? 'inline-block' : 'none' }}> + { translate('INDEX.NATIVE_MODE') } +
@@ -117,19 +130,25 @@ const CoinSelectorsRender = function(item, coin, i) { type="button" className="btn btn-primary" onClick={ () => this.removeCoin(i) }> - +
this.toggleSyncOnlyMode(i) }>{ translate('ADD_COIN.SYNC_ONLY') }
+ onClick={ () => this.toggleSyncOnlyMode(i) }> + { translate('ADD_COIN.SYNC_ONLY') } +
diff --git a/react/src/components/dashboard/atomic/atomic.js b/react/src/components/dashboard/atomic/atomic.js index 0a1cf3b..8bca1e1 100755 --- a/react/src/components/dashboard/atomic/atomic.js +++ b/react/src/components/dashboard/atomic/atomic.js @@ -340,7 +340,13 @@ class Atomic extends React.Component { } if (props.Atomic.response.error === 'less than required responses') { - Store.dispatch(triggerToaster('Basilisk connection error', translate('TOASTR.SERVICE_NOTIFICATION'), 'error')); + Store.dispatch( + triggerToaster( + 'Basilisk connection error', + translate('TOASTR.SERVICE_NOTIFICATION'), + 'error' + ) + ); } } } @@ -469,7 +475,11 @@ class Atomic extends React.Component { for (let i = 0; i < _options.length; i++) { items.push( - + ); } diff --git a/react/src/components/dashboard/atomic/atomic.render.js b/react/src/components/dashboard/atomic/atomic.render.js index 56b35a9..7de3c3c 100644 --- a/react/src/components/dashboard/atomic/atomic.render.js +++ b/react/src/components/dashboard/atomic/atomic.render.js @@ -11,7 +11,9 @@ const AtomicRender = function () {
-

Atomic Explorer

+

+ Atomic Explorer +

@@ -46,7 +48,9 @@ const AtomicRender = function () { + onClick={ this.getAtomicData }> + { translate('ATOMIC.SUBMIT') } +
@@ -54,11 +58,15 @@ const AtomicRender = function () {
-

{ translate('ATOMIC.RAW_OUTPUT') }

+

+ { translate('ATOMIC.RAW_OUTPUT') } +

-
{ this.state.output }
+
+                    { this.state.output }
+                  
diff --git a/react/src/components/dashboard/coinTile/coinTile.js b/react/src/components/dashboard/coinTile/coinTile.js index 9fcb3d1..21e0dbf 100755 --- a/react/src/components/dashboard/coinTile/coinTile.js +++ b/react/src/components/dashboard/coinTile/coinTile.js @@ -52,7 +52,11 @@ class CoinTile extends React.Component { return ( items.map((item, i) => - ) + ) ); } diff --git a/react/src/components/dashboard/coinTile/coinTile.render.js b/react/src/components/dashboard/coinTile/coinTile.render.js index d4b921c..402e9cf 100644 --- a/react/src/components/dashboard/coinTile/coinTile.render.js +++ b/react/src/components/dashboard/coinTile/coinTile.render.js @@ -13,13 +13,21 @@ const CoinTileRender = function() {
- - +
-

{ translate('INDEX.ACTIVE_COINS') }

+

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

diff --git a/react/src/components/dashboard/coinTile/coinTileItem.js b/react/src/components/dashboard/coinTile/coinTileItem.js index 5b6cace..72d7031 100644 --- a/react/src/components/dashboard/coinTile/coinTileItem.js +++ b/react/src/components/dashboard/coinTile/coinTileItem.js @@ -68,8 +68,19 @@ class CoinTileItem extends React.Component { const useAddress = this.props.ActiveCoin.mainBasiliskAddress ? this.props.ActiveCoin.mainBasiliskAddress : this.props.Dashboard.activeHandle[coin]; Store.dispatch(iguanaActiveHandle(true)); - Store.dispatch(getKMDAddressesNative(coin, mode, useAddress)); - Store.dispatch(getShepherdCache(JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey, coin)); + Store.dispatch( + getKMDAddressesNative( + coin, + mode, + useAddress + ) + ); + Store.dispatch( + getShepherdCache( + JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey, + coin + ) + ); if (this.props && this.props.Dashboard && @@ -86,8 +97,18 @@ class CoinTileItem extends React.Component { dashboardChangeActiveCoin(coin, mode) { if (coin !== this.props.ActiveCoin.coin) { - Store.dispatch(stopInterval('sync', this.props.Interval.interval)); - Store.dispatch(stopInterval('basilisk', this.props.Interval.interval)); + Store.dispatch( + stopInterval( + 'sync', + this.props.Interval.interval + ) + ); + Store.dispatch( + stopInterval( + 'basilisk', + this.props.Interval.interval + ) + ); Store.dispatch(dashboardChangeActiveCoin(coin, mode)); this.dispatchCoinActions(coin, mode); @@ -96,7 +117,12 @@ class CoinTileItem extends React.Component { const _iguanaActiveHandle = setInterval(() => { this.dispatchCoinActions(coin, mode); }, IGUNA_ACTIVE_HANDLE_TIMEOUT); - Store.dispatch(startInterval('sync', _iguanaActiveHandle)); + Store.dispatch( + startInterval( + 'sync', + _iguanaActiveHandle + ) + ); } if (mode === 'native') { const _iguanaActiveHandle = setInterval(() => { @@ -130,8 +156,18 @@ class CoinTileItem extends React.Component { 'address': _basiliskMainAddress, })); }, BASILISK_CACHE_UPDATE_TIMEOUT); - Store.dispatch(startInterval('sync', _iguanaActiveHandle)); - Store.dispatch(startInterval('basilisk', _basiliskCache)); + Store.dispatch( + startInterval( + 'sync', + _iguanaActiveHandle + ) + ); + Store.dispatch( + startInterval( + 'basilisk', + _basiliskCache + ) + ); } } } diff --git a/react/src/components/dashboard/coinTile/coinTileItem.render.js b/react/src/components/dashboard/coinTile/coinTileItem.render.js index df96548..baedfbd 100644 --- a/react/src/components/dashboard/coinTile/coinTileItem.render.js +++ b/react/src/components/dashboard/coinTile/coinTileItem.render.js @@ -14,9 +14,13 @@ const CoinTileItemRender = function() { className="img-responsive" src={ `assets/images/cryptologo/${item.coinlogo}.png` } alt={ item.coinname }/> - { item.modecode } + + { item.modecode } + -
{ item.coinname } ({ item.coinlogo.toUpperCase() })
+
+ { item.coinname } ({ item.coinlogo.toUpperCase() }) +
diff --git a/react/src/components/dashboard/jumblr/jumblr.render.js b/react/src/components/dashboard/jumblr/jumblr.render.js index ec694ca..846400d 100644 --- a/react/src/components/dashboard/jumblr/jumblr.render.js +++ b/react/src/components/dashboard/jumblr/jumblr.render.js @@ -11,12 +11,14 @@ const JumblrRender = function() {
- - { translate('JUMBLR.NOTICE') } - + { translate('JUMBLR.NOTICE') } +
{ translate('JUMBLR.DESCRIPTION') }
@@ -24,12 +26,14 @@ const JumblrRender = function() {
- - { translate('JUMBLR.NEED_NATIVE') } - + { translate('JUMBLR.NEED_NATIVE') } +
{ translate('JUMBLR.TO_USE_JUMBLR') }
@@ -96,7 +100,9 @@ const JumblrRender = function() {
-
this.openTab(2) }> +
@@ -127,44 +133,46 @@ const JumblrRender = function() {
- - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + +
{ translate('JUMBLR.BTC_DEPOSIT') } - -
BTC Jumblr - - - { translate('JUMBLR.HIDDEN') } -
{ translate('JUMBLR.KMD_DEPOSIT') }
KMD Jumblr -
{ translate('JUMBLR.BTC_DEPOSIT') } + +
BTC Jumblr + + + { translate('JUMBLR.HIDDEN') } +
{ translate('JUMBLR.KMD_DEPOSIT') }
KMD Jumblr + + + + { translate('JUMBLR.HIDDEN') } - - - { translate('JUMBLR.HIDDEN') } -
@@ -172,41 +180,43 @@ const JumblrRender = function() {
-

{ translate('JUMBLR.JSTATUS') }

+

+ { translate('JUMBLR.JSTATUS') } +

- - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{ translate('JUMBLR.RESULT') } - -
{ translate('JUMBLR.DEPOSITED') }
{ translate('JUMBLR.PUB_TO_PRIV') }
{ translate('JUMBLR.PRIV_TO_PRIV') }
{ translate('JUMBLR.PRIV_TO_PUB') }
{ translate('JUMBLR.FINISHED') }
{ translate('JUMBLR.PENDING') }
{ translate('JUMBLR.RESULT') } + +
{ translate('JUMBLR.DEPOSITED') }
{ translate('JUMBLR.PUB_TO_PRIV') }
{ translate('JUMBLR.PRIV_TO_PRIV') }
{ translate('JUMBLR.PRIV_TO_PUB') }
{ translate('JUMBLR.FINISHED') }
{ translate('JUMBLR.PENDING') }
diff --git a/react/src/components/dashboard/navbar/navbar.js b/react/src/components/dashboard/navbar/navbar.js index 957c0e4..c64ccde 100755 --- a/react/src/components/dashboard/navbar/navbar.js +++ b/react/src/components/dashboard/navbar/navbar.js @@ -24,11 +24,19 @@ class Navbar extends React.Component { } componentWillMount() { - document.addEventListener('click', this.handleClickOutside, false); + document.addEventListener( + 'click', + this.handleClickOutside, + false + ); } componentWillUnmount() { - document.removeEventListener('click', this.handleClickOutside, false); + document.removeEventListener( + 'click', + this.handleClickOutside, + false + ); } handleClickOutside(e) { @@ -58,18 +66,33 @@ class Navbar extends React.Component { } logout() { - Store.dispatch(stopInterval('sync', this.props.Interval.interval)); - Store.dispatch(stopInterval('basilisk', this.props.Interval.interval)); + Store.dispatch( + stopInterval( + 'sync', + this.props.Interval.interval + ) + ); + Store.dispatch( + stopInterval( + 'basilisk', + this.props.Interval.interval + ) + ); Store.dispatch(logout()); } openSyncOnlyModal() { Store.dispatch(getSyncOnlyForks()); - const _iguanaActiveHandle = setInterval(function() { + const _iguanaActiveHandle = setInterval(() => { Store.dispatch(getSyncOnlyForks()); - }.bind(this), 3000); - Store.dispatch(startInterval('syncOnly', _iguanaActiveHandle)); + }, 3000); + Store.dispatch( + startInterval( + 'syncOnly', + _iguanaActiveHandle + ) + ); Store.dispatch(toggleSyncOnlyModal(true)); } diff --git a/react/src/components/dashboard/navbar/navbar.render.js b/react/src/components/dashboard/navbar/navbar.render.js index 4a3bab3..1bba47d 100644 --- a/react/src/components/dashboard/navbar/navbar.render.js +++ b/react/src/components/dashboard/navbar/navbar.render.js @@ -5,16 +5,21 @@ const NavbarRender = function() { return (