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 { translate } from '../../translate/translate';
import Config from '../../config';
import { import {
triggerToaster, triggerToaster,
Config,
toggleAddcoinModal, toggleAddcoinModal,
getDexCoins, getDexCoins,
startIguanaInstance, startIguanaInstance,

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -1,10 +1,10 @@
import { translate } from '../../translate/translate'; import { translate } from '../../translate/translate';
import { import {
triggerToaster, triggerToaster,
Config,
getPassthruAgent, getPassthruAgent,
getKMDAddressesNative getKMDAddressesNative
} from '../actionCreators'; } from '../actionCreators';
import Config from '../../config';
import { import {
logGuiHttp, logGuiHttp,
guiLogState 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 { translate } from '../../translate/translate';
import { import {
triggerToaster, triggerToaster,
Config,
getPassthruAgent, getPassthruAgent,
iguanaHashHex iguanaHashHex
} from '../actionCreators'; } from '../actionCreators';
@ -10,6 +9,7 @@ import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState
} from './log'; } from './log';
import Config from '../../config';
export function sendNativeTx(coin, _payload) { export function sendNativeTx(coin, _payload) {
let ajaxDataToHex; let ajaxDataToHex;

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

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

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

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

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

@ -3,10 +3,8 @@ import {
DASHBOARD_GET_NOTARIES_LIST DASHBOARD_GET_NOTARIES_LIST
} from '../storeType'; } from '../storeType';
import { translate } from '../../translate/translate'; import { translate } from '../../translate/translate';
import { import { triggerToaster } from '../actionCreators';
triggerToaster, import Config from '../../config';
Config
} from '../actionCreators';
import { import {
logGuiHttp, logGuiHttp,
guiLogState 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 { translate } from '../../translate/translate';
import { import {
triggerToaster, triggerToaster,
Config,
getDispatch getDispatch
} from '../actionCreators'; } from '../actionCreators';
import Config from '../../config';
import { import {
logGuiHttp, logGuiHttp,
guiLogState guiLogState

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

11
react/src/config.js

@ -1,4 +1,5 @@
module.exports = { let Config;
let _config = {
iguanaCorePort: 7778, iguanaCorePort: 7778,
agamaPort: 17777, agamaPort: 17777,
enableCacheApi: true, enableCacheApi: true,
@ -12,3 +13,11 @@ module.exports = {
}, },
iguanaLessMode: true, 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'; import Config from '../config';
export function translate(langID) { export function translate(langID) {
let defaultLang = Config.defaultLang; let defaultLang = Config.defaultLang || 'EN';
if (langID && if (langID &&
langID.indexOf('.') > -1) { langID.indexOf('.') > -1) {
@ -13,12 +13,12 @@ export function translate(langID) {
_lang[defaultLang][langIDComponents[0]][langIDComponents[1]]) { _lang[defaultLang][langIDComponents[0]][langIDComponents[1]]) {
return _lang[defaultLang][langIDComponents[0]][langIDComponents[1]]; return _lang[defaultLang][langIDComponents[0]][langIDComponents[1]];
} else { } else {
console.log('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID); console.warn('Missing translation in js/' + defaultLang.toLowerCase() + '.js ' + langID);
return '--> ' + langID + ' <--'; return '--> ' + langID + ' <--';
} }
} else { } else {
if (langID.length) { 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 + ' <--'; return '--> ' + langID + ' <--';
} }
} }

Loading…
Cancel
Save