Browse Source

refactored config var import

all-modes
pbca26 8 years ago
parent
commit
bba59c560f
  1. 2
      react/src/actions/actions/addCoin.js
  2. 6
      react/src/actions/actions/addressBalance.js
  3. 6
      react/src/actions/actions/atomic.js
  4. 7
      react/src/actions/actions/basiliskCache.js
  5. 6
      react/src/actions/actions/basiliskProcessAddress.js
  6. 2
      react/src/actions/actions/basiliskTxHistory.js
  7. 6
      react/src/actions/actions/cli.js
  8. 6
      react/src/actions/actions/coinList.js
  9. 6
      react/src/actions/actions/createWallet.js
  10. 2
      react/src/actions/actions/dexCoins.js
  11. 6
      react/src/actions/actions/edexBalance.js
  12. 6
      react/src/actions/actions/edexGetTx.js
  13. 2
      react/src/actions/actions/fullTxHistory.js
  14. 5
      react/src/actions/actions/getAddrByAccount.js
  15. 5
      react/src/actions/actions/iguanaHelpers.js
  16. 6
      react/src/actions/actions/iguanaInstance.js
  17. 6
      react/src/actions/actions/log.js
  18. 6
      react/src/actions/actions/logout.js
  19. 2
      react/src/actions/actions/nativeBalance.js
  20. 2
      react/src/actions/actions/nativeNewAddress.js
  21. 2
      react/src/actions/actions/nativeSend.js
  22. 2
      react/src/actions/actions/nativeSyncInfo.js
  23. 2
      react/src/actions/actions/nativeTxHistory.js
  24. 6
      react/src/actions/actions/notary.js
  25. 2
      react/src/actions/actions/sendFullBasilisk.js
  26. 6
      react/src/actions/actions/settings.js
  27. 6
      react/src/actions/actions/syncInfo.js
  28. 6
      react/src/actions/actions/syncOnly.js
  29. 6
      react/src/actions/actions/sysInfo.js
  30. 6
      react/src/actions/actions/update.js
  31. 2
      react/src/actions/actions/walletAuth.js
  32. 2
      react/src/components/addcoin/addcoin.js
  33. 2
      react/src/components/addcoin/addcoinOptionsCrypto.js
  34. 2
      react/src/components/dashboard/coinTile/coinTileItem.js
  35. 2
      react/src/components/dashboard/navbar/navbar.js
  36. 2
      react/src/components/dashboard/notifications/notifications.js
  37. 2
      react/src/components/dashboard/settings/settings.js
  38. 2
      react/src/components/dashboard/walletsData/walletsData.js
  39. 4
      react/src/components/dashboard/walletsData/walletsData.render.js
  40. 7
      react/src/components/dashboard/walletsNative/walletsNative.js
  41. 2
      react/src/components/dashboard/walletsNav/walletsNav.js
  42. 2
      react/src/components/login/login.js
  43. 11
      react/src/config.js
  44. 6
      react/src/translate/translate.js

2
react/src/actions/actions/addCoin.js

@ -1,7 +1,7 @@
import { translate } from '../../translate/translate';
import Config from '../../config';
import {
triggerToaster,
Config,
toggleAddcoinModal,
getDexCoins,
startIguanaInstance,

6
react/src/actions/actions/addressBalance.js

@ -1,9 +1,6 @@
import {
ACTIVE_COIN_GET_ADDRESSES
} from '../storeType';
import { ACTIVE_COIN_GET_ADDRESSES } from '../storeType';
import {
triggerToaster,
Config,
shepherdGroomPost,
getPassthruAgent,
iguanaHashHex
@ -12,6 +9,7 @@ import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
function getKMDAddressesNativeState(json) {
return {

6
react/src/actions/actions/atomic.js

@ -1,12 +1,10 @@
import { ATOMIC } from '../storeType';
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function atomic(payload) {
return dispatch => {

7
react/src/actions/actions/basiliskCache.js

@ -1,15 +1,12 @@
import { DASHBOARD_ACTIVE_COIN_GET_CACHE } from '../storeType';
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
// TODO: rewrite cache API to use POST
export function deleteCacheFile(_payload) {
return dispatch => {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/groom`, {

6
react/src/actions/actions/basiliskProcessAddress.js

@ -1,12 +1,10 @@
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function checkAddressBasilisk(coin, address) {
const payload = {

2
react/src/actions/actions/basiliskTxHistory.js

@ -1,12 +1,12 @@
import {
triggerToaster,
Config,
getNativeTxHistoryState
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function getBasiliskTransactionsList(coin, address) {
const pubkey = JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey;

6
react/src/actions/actions/cli.js

@ -1,12 +1,10 @@
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import { CLI } from '../storeType';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function shepherdCliPromise(mode, chain, cmd) {
const _payload = {

6
react/src/actions/actions/coinList.js

@ -1,11 +1,9 @@
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function shepherdGetCoinList() {
return new Promise((resolve, reject) => {

6
react/src/actions/actions/createWallet.js

@ -1,12 +1,10 @@
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
function createNewWalletState(json) {
if (json &&

2
react/src/actions/actions/dexCoins.js

@ -1,12 +1,12 @@
import {
triggerToaster,
Config,
dashboardCoinsState
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function getDexCoins() {
const _payload = {

6
react/src/actions/actions/edexBalance.js

@ -1,12 +1,10 @@
import { DASHBOARD_ACTIVE_COIN_BALANCE } from '../storeType';
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function iguanaEdexBalance(coin) {
const _payload = {

6
react/src/actions/actions/edexGetTx.js

@ -1,11 +1,9 @@
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function edexGetTransaction(data, dispatch) {
const payload = {

2
react/src/actions/actions/fullTxHistory.js

@ -1,12 +1,12 @@
import {
triggerToaster,
Config,
getNativeTxHistoryState
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function getFullTransactionsList(coin) {
const payload = {

5
react/src/actions/actions/getAddrByAccount.js

@ -1,12 +1,9 @@
import { ACTIVE_COIN_GET_ADDRESSES } from '../storeType';
import {
triggerToaster,
Config
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function getAddressesByAccountState(json, coin, mode) {
if (mode === 'full' ||

5
react/src/actions/actions/iguanaHelpers.js

@ -1,11 +1,8 @@
import {
triggerToaster,
Config
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
import { checkAC } from '../../components/addcoin/payload';
export function getPassthruAgent(coin) {

6
react/src/actions/actions/iguanaInstance.js

@ -1,11 +1,9 @@
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function restartIguanaInstance(pmid) {
return new Promise((resolve, reject) => {

6
react/src/actions/actions/log.js

@ -1,8 +1,6 @@
import { LOG_GUI_HTTP } from '../storeType';
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import Config from '../../config';
export function logGuiHttp(payload) {
return dispatch => {

6
react/src/actions/actions/logout.js

@ -2,10 +2,8 @@ import {
LOGIN,
LOGOUT
} from '../storeType';
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState

2
react/src/actions/actions/nativeBalance.js

@ -1,9 +1,9 @@
import { DASHBOARD_ACTIVE_COIN_NATIVE_BALANCE } from '../storeType';
import {
triggerToaster,
Config,
getPassthruAgent
} from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState

2
react/src/actions/actions/nativeNewAddress.js

@ -1,10 +1,10 @@
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config,
getPassthruAgent,
getKMDAddressesNative
} from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState

2
react/src/actions/actions/nativeSend.js

@ -2,7 +2,6 @@ import { DASHBOARD_ACTIVE_COIN_NATIVE_OPIDS } from '../storeType';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config,
getPassthruAgent,
iguanaHashHex
} from '../actionCreators';
@ -10,6 +9,7 @@ import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function sendNativeTx(coin, _payload) {
let ajaxDataToHex;

2
react/src/actions/actions/nativeSyncInfo.js

@ -1,7 +1,6 @@
import { SYNCING_NATIVE_MODE } from '../storeType';
import {
triggerToaster,
Config,
getPassthruAgent,
getDebugLog
} from '../actionCreators';
@ -9,6 +8,7 @@ import {
logGuiHttp,
guiLogState
} from './log';
import Config from '../../config';
export function getSyncInfoNativeKMD(skipDebug) {
const coin = 'KMD';

2
react/src/actions/actions/nativeTxHistory.js

@ -1,9 +1,9 @@
import {
triggerToaster,
Config,
getPassthruAgent,
getNativeTxHistoryState
} from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState

6
react/src/actions/actions/notary.js

@ -3,10 +3,8 @@ import {
DASHBOARD_GET_NOTARIES_LIST
} from '../storeType';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState

2
react/src/actions/actions/sendFullBasilisk.js

@ -2,9 +2,9 @@ import { DASHBOARD_ACTIVE_COIN_SENDTO } from '../storeType';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config,
getDispatch
} from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState

6
react/src/actions/actions/settings.js

@ -6,10 +6,8 @@ import {
LOAD_APP_CONFIG
} from '../storeType';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState

6
react/src/actions/actions/syncInfo.js

@ -1,8 +1,6 @@
import { SYNCING_FULL_MODE } from '../storeType';
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState

6
react/src/actions/actions/syncOnly.js

@ -3,10 +3,8 @@ import {
SYNC_ONLY_DATA
} from '../storeType';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config
} from '../actionCreators';
import Config from '../../config';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState

6
react/src/actions/actions/sysInfo.js

@ -1,7 +1,5 @@
import {
triggerToaster,
Config
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState

6
react/src/actions/actions/update.js

@ -1,7 +1,5 @@
import {
Config,
triggerToaster
} from '../actionCreators';
import { triggerToaster } from '../actionCreators';
import Config from '../../config';
import {
logGuiHttp,
guiLogState

2
react/src/actions/actions/walletAuth.js

@ -3,9 +3,9 @@ import {
ACTIVE_HANDLE
} from '../storeType';
import { translate } from '../../translate/translate';
import Config from '../../config';
import {
triggerToaster,
Config,
getMainAddressState,
updateErrosStack
} from '../actionCreators';

2
react/src/components/addcoin/addcoin.js

@ -1,7 +1,7 @@
import React from 'react';
import { translate } from '../../translate/translate';
import Config from '../../config';
import {
Config,
addCoin,
toggleAddcoinModal,
triggerToaster,

2
react/src/components/addcoin/addcoinOptionsCrypto.js

@ -1,6 +1,6 @@
import React from 'react';
import { translate } from '../../translate/translate';
import { Config } from '../../actions/actionCreators';
import Config from '../../config';
class AddCoinOptionsCrypto extends React.Component {
constructor(props) {

2
react/src/components/dashboard/coinTile/coinTileItem.js

@ -1,6 +1,5 @@
import React from 'react';
import {
Config,
dashboardChangeActiveCoin,
iguanaActiveHandle,
getAddressesByAccount,
@ -21,6 +20,7 @@ import {
getDebugLog
} from '../../../actions/actionCreators';
import Store from '../../../store';
import Config from '../../../config';
import CoinTileItemRender from './coinTileItem.render';

2
react/src/components/dashboard/navbar/navbar.js

@ -7,9 +7,9 @@ import {
toggleSyncOnlyModal,
getSyncOnlyForks,
logout,
Config
} from '../../../actions/actionCreators';
import Store from '../../../store';
import Config from '../../../config';
import NavbarRender from './navbar.render';

2
react/src/components/dashboard/notifications/notifications.js

@ -1,6 +1,6 @@
import React from 'react';
import { sortByDate } from '../../../util/sort';
import { Config } from '../../../actions/actionCreators';
import Config from '../../../config';
import {
NotificationsByTypeRender,
NotificationsModalRender,

2
react/src/components/dashboard/settings/settings.js

@ -1,7 +1,7 @@
import React from 'react';
import { translate } from '../../../translate/translate';
import Config from '../../../config';
import {
Config,
iguanaActiveHandle,
encryptWallet,
settingsWifkeyState,

2
react/src/components/dashboard/walletsData/walletsData.js

@ -1,8 +1,8 @@
import React from 'react';
import { translate } from '../../../translate/translate';
import { sortByDate } from '../../../util/sort';
import Config from '../../../config';
import {
Config,
basiliskRefresh,
basiliskConnection,
toggleDashboardTxInfoModal,

4
react/src/components/dashboard/walletsData/walletsData.render.js

@ -104,8 +104,8 @@ export const TxHistoryListRender = function(tx, index) {
};
export const AddressListRender = function() {
const isMultiPublicAddress = this.props.ActiveCoin.addresses.public && this.props.ActiveCoin.addresses.public.length > 1;
const isMultiPrivateAddress = this.props.ActiveCoin.addresses.private && this.props.ActiveCoin.addresses.private.length > 1;
const isMultiPublicAddress = this.props.ActiveCoin.addresses && this.props.ActiveCoin.addresses.public && this.props.ActiveCoin.addresses.public.length > 1;
const isMultiPrivateAddress = this.props.ActiveCoin.addresses && this.props.ActiveCoin.addresses.private && this.props.ActiveCoin.addresses.private.length > 1;
if (isMultiPublicAddress ||
isMultiPrivateAddress) {

7
react/src/components/dashboard/walletsNative/walletsNative.js

@ -1,11 +1,8 @@
import React from 'react';
import WalletsNativeRender from './walletsNative.render';
import { translate } from '../../../translate/translate';
import {
Config,
triggerToaster
} from '../../../actions/actionCreators';
import { triggerToaster } from '../../../actions/actionCreators';
import Config from '../../../config';
import Store from '../../../store';
import { SocketProvider } from 'socket.io-react';

2
react/src/components/dashboard/walletsNav/walletsNav.js

@ -1,6 +1,5 @@
import React from 'react';
import {
Config,
copyCoinAddress,
iguanaEdexBalance,
toggleSendCoinForm,
@ -9,6 +8,7 @@ import {
toggleDashboardActiveSection
} from '../../../actions/actionCreators';
import Store from '../../../store';
import Config from '../../../config';
import {
WalletsNavNoWalletRender,
WalletsNavWithWalletRender

2
react/src/components/login/login.js

@ -1,6 +1,5 @@
import React from 'react';
import {
Config,
toggleAddcoinModal,
iguanaWalletPassphrase,
iguanaActiveHandle,
@ -11,6 +10,7 @@ import {
createNewWallet,
triggerToaster
} from '../../actions/actionCreators';
import Config from '../../config';
import Store from '../../store';
import { PassPhraseGenerator } from '../../util/crypto/passphrasegenerator';
import SwallModalRender from './swall-modal.render';

11
react/src/config.js

@ -1,4 +1,5 @@
module.exports = {
let Config;
let _config = {
iguanaCorePort: 7778,
agamaPort: 17777,
enableCacheApi: true,
@ -12,3 +13,11 @@ module.exports = {
},
iguanaLessMode: true,
};
try {
Config = window.require('electron').remote.getCurrentWindow().appConfig;
} catch (e) {
Config = _config;
}
export default Config;

6
react/src/translate/translate.js

@ -2,7 +2,7 @@ import { _lang } from './en';
import Config from '../config';
export function translate(langID) {
let defaultLang = Config.defaultLang;
let defaultLang = Config.defaultLang || 'EN';
if (langID &&
langID.indexOf('.') > -1) {
@ -13,12 +13,12 @@ export function translate(langID) {
_lang[defaultLang][langIDComponents[0]][langIDComponents[1]]) {
return _lang[defaultLang][langIDComponents[0]][langIDComponents[1]];
} else {
console.log('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID);
console.warn('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID);
return '--> ' + langID + ' <--';
}
} else {
if (langID.length) {
console.log('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID);
console.warn('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID);
return '--> ' + langID + ' <--';
}
}

Loading…
Cancel
Save