Browse Source

moved actions to a separate folder

all-modes
pbca26 8 years ago
parent
commit
5aae4cddc4
  1. 64
      react/src/actions/actionCreators.js
  2. 8
      react/src/actions/actions/addCoin.js
  3. 18
      react/src/actions/actions/addressBalance.js
  4. 6
      react/src/actions/actions/atomic.js
  5. 6
      react/src/actions/actions/basiliskCache.js
  6. 5
      react/src/actions/actions/basiliskProcessAddress.js
  7. 3
      react/src/actions/actions/basiliskTxHistory.js
  8. 3
      react/src/actions/actions/coinList.js
  9. 10
      react/src/actions/actions/copyAddress.js
  10. 5
      react/src/actions/actions/createWallet.js
  11. 3
      react/src/actions/actions/dexCoins.js
  12. 6
      react/src/actions/actions/edexBalance.js
  13. 3
      react/src/actions/actions/edexGetTx.js
  14. 3
      react/src/actions/actions/fullTxHistory.js
  15. 6
      react/src/actions/actions/getAddrByAccount.js
  16. 5
      react/src/actions/actions/iguanaHelpers.js
  17. 3
      react/src/actions/actions/iguanaInstance.js
  18. 6
      react/src/actions/actions/log.js
  19. 6
      react/src/actions/actions/logout.js
  20. 6
      react/src/actions/actions/nativeBalance.js
  21. 5
      react/src/actions/actions/nativeNewAddress.js
  22. 10
      react/src/actions/actions/nativeSend.js
  23. 6
      react/src/actions/actions/nativeSyncInfo.js
  24. 3
      react/src/actions/actions/nativeTxHistory.js
  25. 17
      react/src/actions/actions/notary.js
  26. 6
      react/src/actions/actions/openAlias.js
  27. 15
      react/src/actions/actions/sendFullBasilisk.js
  28. 22
      react/src/actions/actions/settings.js
  29. 6
      react/src/actions/actions/syncInfo.js
  30. 13
      react/src/actions/actions/syncOnly.js
  31. 3
      react/src/actions/actions/sysInfo.js
  32. 13
      react/src/actions/actions/walletAuth.js

64
react/src/actions/actionCreators.js

@ -8,38 +8,38 @@ import {
logGuiHttp,
getAgamaLog,
guiLogState
} from './log';
export * from './nativeSyncInfo';
export * from './basiliskCache';
export * from './nativeSend';
export * from './coinList';
export * from './createWallet';
export * from './nativeTxHistory';
export * from './nativeBalance';
export * from './nativeNewAddress';
export * from './logout';
export * from './basiliskProcessAddress';
export * from './edexGetTx';
export * from './sendFullBasilisk';
export * from './settings';
export * from './syncOnly';
export * from './iguanaInstance';
export * from './notary';
export * from './edexBalance';
export * from './addCoin';
export * from './addressBalance';
export * from './syncInfo';
export * from './getAddrByAccount';
export * from './atomic';
export * from './walletAuth';
export * from './openAlias';
export * from './copyAddress';
export * from './sysInfo';
export * from './dexCoins';
export * from './fullTxHistory';
export * from './basiliskTxHistory';
export * from './iguanaHelpers';
} from './actions/log';
export * from './actions/nativeSyncInfo';
export * from './actions/basiliskCache';
export * from './actions/nativeSend';
export * from './actions/coinList';
export * from './actions/createWallet';
export * from './actions/nativeTxHistory';
export * from './actions/nativeBalance';
export * from './actions/nativeNewAddress';
export * from './actions/logout';
export * from './actions/basiliskProcessAddress';
export * from './actions/edexGetTx';
export * from './actions/sendFullBasilisk';
export * from './actions/settings';
export * from './actions/syncOnly';
export * from './actions/iguanaInstance';
export * from './actions/notary';
export * from './actions/edexBalance';
export * from './actions/addCoin';
export * from './actions/addressBalance';
export * from './actions/syncInfo';
export * from './actions/getAddrByAccount';
export * from './actions/atomic';
export * from './actions/walletAuth';
export * from './actions/openAlias';
export * from './actions/copyAddress';
export * from './actions/sysInfo';
export * from './actions/dexCoins';
export * from './actions/fullTxHistory';
export * from './actions/basiliskTxHistory';
export * from './actions/iguanaHelpers';
export let Config;

8
react/src/actions/addCoin.js → react/src/actions/actions/addCoin.js

@ -1,12 +1,11 @@
import * as storeType from './storeType';
import { translate } from '../translate/translate';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config,
toggleAddcoinModal,
getDexCoins,
startIguanaInstance
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -17,7 +16,7 @@ import {
startCrypto,
checkCoinType,
checkAC
} from '../components/addcoin/payload';
} from '../../components/addcoin/payload';
export function addCoin(coin, mode, syncOnly, port) {
if (mode === '-1') {
@ -164,7 +163,6 @@ export function shepherdHerd(coin, mode, path) {
herdData.ac_options.push(`-ac_supply=${supply}`);
}
console.log('herdData', herdData);
return dispatch => {
return fetch(`http://127.0.0.1:${Config.agamaPort}/shepherd/herd`, {
method: 'POST',

18
react/src/actions/addressBalance.js → react/src/actions/actions/addressBalance.js

@ -1,10 +1,12 @@
import * as storeType from './storeType';
import {
ACTIVE_COIN_GET_ADDRESSES
} from '../storeType';
import {
triggerToaster,
Config,
shepherdGroomPost,
getPassthruAgent
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -12,13 +14,16 @@ import {
function getKMDAddressesNativeState(json) {
return {
type: storeType.ACTIVE_COIN_GET_ADDRESSES,
type: ACTIVE_COIN_GET_ADDRESSES,
addresses: json,
}
}
export function getKMDAddressesNative(coin, mode, currentAddress) {
const type = ['public', 'private'];
const type = [
'public',
'private'
];
if (mode !== 'native') {
type.pop();
@ -217,7 +222,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
newAddressArray[a] = [];
for (let b = 0; b < result[a].length; b++) {
var filteredArray;
let filteredArray;
if (mode === 'basilisk') {
filteredArray = json.map(res => res.amount);
@ -226,8 +231,7 @@ export function getKMDAddressesNative(coin, mode, currentAddress) {
}
let sum = 0;
for (let i=0; i < filteredArray.length; i++) {
for (let i = 0; i < filteredArray.length; i++) {
sum += filteredArray[i];
}

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

@ -1,8 +1,8 @@
import * as storeType from './storeType';
import { ATOMIC } from '../storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -47,7 +47,7 @@ export function atomic(payload) {
function atomicState(json) {
return {
type: storeType.ATOMIC,
type: ATOMIC,
response: json,
}
}

6
react/src/actions/basiliskCache.js → react/src/actions/actions/basiliskCache.js

@ -1,8 +1,8 @@
import * as storeType from './storeType';
import { DASHBOARD_ACTIVE_COIN_GET_CACHE } from '../storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -101,7 +101,7 @@ function getShepherdCacheState(json, pubkey, coin) {
}
} else {
return {
type: storeType.DASHBOARD_ACTIVE_COIN_GET_CACHE,
type: DASHBOARD_ACTIVE_COIN_GET_CACHE,
cache: json && json.result && json.result.basilisk ? json.result.basilisk : null,
}
}

5
react/src/actions/basiliskProcessAddress.js → react/src/actions/actions/basiliskProcessAddress.js

@ -1,9 +1,8 @@
import * as storeType from './storeType';
import { translate } from '../translate/translate';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState

3
react/src/actions/basiliskTxHistory.js → react/src/actions/actions/basiliskTxHistory.js

@ -1,9 +1,8 @@
import * as storeType from './storeType';
import {
triggerToaster,
Config,
getNativeTxHistoryState
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState

3
react/src/actions/coinList.js → react/src/actions/actions/coinList.js

@ -1,8 +1,7 @@
import * as storeType from './storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState

10
react/src/actions/copyAddress.js → react/src/actions/actions/copyAddress.js

@ -1,10 +1,6 @@
import { copyToClipboard } from '../util/copyToClipboard';
import { translate } from '../translate/translate';
import * as storeType from './storeType';
import {
triggerToaster,
Config
} from './actionCreators';
import { copyToClipboard } from '../../util/copyToClipboard';
import { translate } from '../../translate/translate';
import { triggerToaster } from '../actionCreators';
export function copyCoinAddress(address) {
const _result = copyToClipboard(address);

5
react/src/actions/createWallet.js → react/src/actions/actions/createWallet.js

@ -1,9 +1,8 @@
import * as storeType from './storeType';
import { translate } from '../translate/translate';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState

3
react/src/actions/dexCoins.js → react/src/actions/actions/dexCoins.js

@ -1,9 +1,8 @@
import * as storeType from './storeType';
import {
triggerToaster,
Config,
dashboardCoinsState
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState

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

@ -1,8 +1,8 @@
import * as storeType from './storeType';
import { DASHBOARD_ACTIVE_COIN_BALANCE } from '../storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -49,7 +49,7 @@ export function iguanaEdexBalance(coin) {
function iguanaEdexBalanceState(json) {
return {
type: storeType.DASHBOARD_ACTIVE_COIN_BALANCE,
type: DASHBOARD_ACTIVE_COIN_BALANCE,
balance: json && json.result ? json.result : 0,
}
}

3
react/src/actions/edexGetTx.js → react/src/actions/actions/edexGetTx.js

@ -1,8 +1,7 @@
import * as storeType from './storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState

3
react/src/actions/fullTxHistory.js → react/src/actions/actions/fullTxHistory.js

@ -1,9 +1,8 @@
import * as storeType from './storeType';
import {
triggerToaster,
Config,
getNativeTxHistoryState
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState

6
react/src/actions/getAddrByAccount.js → react/src/actions/actions/getAddrByAccount.js

@ -1,8 +1,8 @@
import * as storeType from './storeType';
import { ACTIVE_COIN_GET_ADDRESSES } from '../storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -24,7 +24,7 @@ export function getAddressesByAccountState(json, coin, mode) {
}
return {
type: storeType.ACTIVE_COIN_GET_ADDRESSES,
type: ACTIVE_COIN_GET_ADDRESSES,
addresses: { 'public': json.result },
}
}

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

@ -1,13 +1,12 @@
import * as storeType from './storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
} from './log';
import { checkAC } from '../components/addcoin/payload';
import { checkAC } from '../../components/addcoin/payload';
export function getPassthruAgent(coin) {
let passthruAgent;

3
react/src/actions/iguanaInstance.js → react/src/actions/actions/iguanaInstance.js

@ -1,8 +1,7 @@
import * as storeType from './storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState

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

@ -1,8 +1,8 @@
import * as storeType from './storeType';
import { LOG_GUI_HTTP } from '../storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
export function logGuiHttp(payload) {
return dispatch => {
@ -43,7 +43,7 @@ export function getAgamaLog(type) {
export function guiLogState(logData) {
return {
type: storeType.LOG_GUI_HTTP,
type: LOG_GUI_HTTP,
timestamp: logData.timestamp,
log: {
timestamp: logData.timestamp,

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

@ -1,8 +1,8 @@
import * as storeType from './storeType';
import { LOGIN } from '../storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -12,7 +12,7 @@ function logoutState(json, dispatch) {
sessionStorage.removeItem('IguanaActiveAccount');
return {
type: storeType.LOGIN,
type: LOGIN,
isLoggedIn: false,
}
}

6
react/src/actions/nativeBalance.js → react/src/actions/actions/nativeBalance.js

@ -1,9 +1,9 @@
import * as storeType from './storeType';
import { DASHBOARD_ACTIVE_COIN_NATIVE_BALANCE } from '../storeType';
import {
triggerToaster,
Config,
getPassthruAgent
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -73,7 +73,7 @@ export function getKMDBalanceTotal(coin) {
export function getNativeBalancesState(json) {
return {
type: storeType.DASHBOARD_ACTIVE_COIN_NATIVE_BALANCE,
type: DASHBOARD_ACTIVE_COIN_NATIVE_BALANCE,
balance: json && !json.error ? json : 0,
}
}

5
react/src/actions/nativeNewAddress.js → react/src/actions/actions/nativeNewAddress.js

@ -1,10 +1,9 @@
import * as storeType from './storeType';
import { translate } from '../translate/translate';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config,
getPassthruAgent
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState

10
react/src/actions/nativeSend.js → react/src/actions/actions/nativeSend.js

@ -1,11 +1,11 @@
import * as storeType from './storeType';
import { translate } from '../translate/translate';
import { DASHBOARD_ACTIVE_COIN_NATIVE_OPIDS } from '../storeType';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config,
getPassthruAgent,
iguanaHashHex
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -71,7 +71,7 @@ export function sendNativeTx(coin, _payload) {
.then(function(response) {
if (_apiMethod === 'sendtoaddress') {
const _response = response.text().then(function(text) { return text; });
console.log('native sendtoaddress', _response);
return _response;
} else {
@ -98,7 +98,7 @@ export function sendNativeTx(coin, _payload) {
export function getKMDOPIDState(json) {
return {
type: storeType.DASHBOARD_ACTIVE_COIN_NATIVE_OPIDS,
type: DASHBOARD_ACTIVE_COIN_NATIVE_OPIDS,
opids: json,
}
}

6
react/src/actions/nativeSyncInfo.js → react/src/actions/actions/nativeSyncInfo.js

@ -1,10 +1,10 @@
import * as storeType from './storeType';
import { SYNCING_NATIVE_MODE } from '../storeType';
import {
triggerToaster,
Config,
getPassthruAgent,
getDebugLog
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -60,7 +60,7 @@ function getSyncInfoNativeState(json, coin, skipDebug) {
return getSyncInfoNativeKMD(skipDebug);
} else {
return {
type: storeType.SYNCING_NATIVE_MODE,
type: SYNCING_NATIVE_MODE,
progress: json,
}
}

3
react/src/actions/nativeTxHistory.js → react/src/actions/actions/nativeTxHistory.js

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

17
react/src/actions/notary.js → react/src/actions/actions/notary.js

@ -1,9 +1,12 @@
import * as storeType from './storeType';
import { translate } from '../translate/translate';
import {
DASHBOARD_CONNECT_NOTARIES,
DASHBOARD_GET_NOTARIES_LIST
} from '../storeType';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -66,7 +69,7 @@ function updateNotaryNodeConState(json, totalNodes, currentNodeIndex, currentNod
if (json &&
json.error === 'less than required responses') {
return {
type: storeType.DASHBOARD_CONNECT_NOTARIES,
type: DASHBOARD_CONNECT_NOTARIES,
total: totalNodes - 1,
current: currentNodeIndex,
name: currentNodeName,
@ -74,7 +77,7 @@ function updateNotaryNodeConState(json, totalNodes, currentNodeIndex, currentNod
}
} else {
return {
type: storeType.DASHBOARD_CONNECT_NOTARIES,
type: DASHBOARD_CONNECT_NOTARIES,
total: totalNodes - 1,
current: currentNodeIndex,
name: currentNodeName,
@ -89,7 +92,7 @@ function connectAllNotaryNodes(json, dispatch) {
dispatch(initNotaryNodesConSequence(json));
return {
type: storeType.DASHBOARD_CONNECT_NOTARIES,
type: DASHBOARD_CONNECT_NOTARIES,
total: json.length - 1,
current: 0,
name: json[0],
@ -125,7 +128,7 @@ function getDexNotariesState(json) {
}
} else {
return {
type: storeType.DASHBOARD_GET_NOTARIES_LIST,
type: DASHBOARD_GET_NOTARIES_LIST,
notaries: json,
}
}

6
react/src/actions/openAlias.js → react/src/actions/actions/openAlias.js

@ -1,8 +1,4 @@
import * as storeType from './storeType';
import {
triggerToaster,
Config
} from './actionCreators';
import { triggerToaster } from '../actionCreators';
import {
logGuiHttp,
guiLogState

15
react/src/actions/sendFullBasilisk.js → react/src/actions/actions/sendFullBasilisk.js

@ -1,10 +1,10 @@
import * as storeType from './storeType';
import { translate } from '../translate/translate';
import { DASHBOARD_ACTIVE_COIN_SENDTO } from '../storeType';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config,
getDispatch
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -125,7 +125,6 @@ export function iguanaUTXORawTX(data, dispatch) {
},
'utxos': data.utxos,
};
console.log('iguanaUTXORawTXExport', payload);
return new Promise((resolve, reject) => {
const _timestamp = Date.now();
@ -218,14 +217,14 @@ function sendToAddressState(json, dispatch) {
dispatch(triggerToaster(true, json.error, 'Error', 'error'));
return {
type: storeType.DASHBOARD_ACTIVE_COIN_SENDTO,
type: DASHBOARD_ACTIVE_COIN_SENDTO,
lastSendToResponse: json,
}
} else if (json && json.result && json.complete) {
dispatch(triggerToaster(true, translate('TOASTR.TX_SENT_ALT'), translate('TOASTR.WALLET_NOTIFICATION'), 'success'));
return {
type: storeType.DASHBOARD_ACTIVE_COIN_SENDTO,
type: DASHBOARD_ACTIVE_COIN_SENDTO,
lastSendToResponse: json,
}
}
@ -233,14 +232,14 @@ function sendToAddressState(json, dispatch) {
export function sendToAddressStateAlt(json) {
return {
type: storeType.DASHBOARD_ACTIVE_COIN_SENDTO,
type: DASHBOARD_ACTIVE_COIN_SENDTO,
lastSendToResponse: json,
}
}
export function clearLastSendToResponseState() {
return {
type: storeType.DASHBOARD_ACTIVE_COIN_SENDTO,
type: DASHBOARD_ACTIVE_COIN_SENDTO,
lastSendToResponse: null,
}
}

22
react/src/actions/settings.js → react/src/actions/actions/settings.js

@ -1,9 +1,15 @@
import * as storeType from './storeType';
import { translate } from '../translate/translate';
import {
LOAD_APP_INFO,
GET_WIF_KEY,
GET_DEBUG_LOG,
GET_PEERS_LIST,
LOAD_APP_CONFIG
} from '../storeType';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -11,7 +17,7 @@ import {
function getAppInfoState(json) {
return {
type: storeType.LOAD_APP_INFO,
type: LOAD_APP_INFO,
info: json,
}
}
@ -35,7 +41,7 @@ export function getAppInfo() {
export function settingsWifkeyState(json, coin) {
return {
type: storeType.GET_WIF_KEY,
type: GET_WIF_KEY,
wifkey: json[`{$coin}wif`],
address: json[coin],
}
@ -117,7 +123,7 @@ function getDebugLogState(json) {
const _data = json.result.replace('\n', '\r\n');
return {
type: storeType.GET_DEBUG_LOG,
type: GET_DEBUG_LOG,
data: _data,
}
}
@ -201,7 +207,7 @@ export function getPeersListState(json) {
}
return {
type: storeType.GET_PEERS_LIST,
type: GET_PEERS_LIST,
supernetPeers: json && json.supernet[0] ? json.supernet : null,
rawPeers: peersList,
}
@ -295,7 +301,7 @@ export function saveAppConfig(_payload) {
function getAppConfigState(json) {
return {
type: storeType.LOAD_APP_CONFIG,
type: LOAD_APP_CONFIG,
config: json,
}
}

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

@ -1,8 +1,8 @@
import * as storeType from './storeType';
import { SYNCING_FULL_MODE } from '../storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -18,7 +18,7 @@ function getSyncInfoState(json) {
}
return {
type: storeType.SYNCING_FULL_MODE,
type: SYNCING_FULL_MODE,
progress: json,
}
}

13
react/src/actions/syncOnly.js → react/src/actions/actions/syncOnly.js

@ -1,9 +1,12 @@
import * as storeType from './storeType';
import { translate } from '../translate/translate';
import {
SYNC_ONLY_MODAL_TOGGLE,
SYNC_ONLY_DATA
} from '../storeType';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -11,14 +14,14 @@ import {
export function toggleSyncOnlyModal(display) {
return {
type: storeType.SYNC_ONLY_MODAL_TOGGLE,
type: SYNC_ONLY_MODAL_TOGGLE,
display,
}
}
function getSyncOnlyForksState(json) {
return {
type: storeType.SYNC_ONLY_DATA,
type: SYNC_ONLY_DATA,
forks: JSON.parse(json.result),
}
}

3
react/src/actions/sysInfo.js → react/src/actions/actions/sysInfo.js

@ -1,8 +1,7 @@
import * as storeType from './storeType';
import {
triggerToaster,
Config
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState

13
react/src/actions/walletAuth.js → react/src/actions/actions/walletAuth.js

@ -1,11 +1,14 @@
import * as storeType from './storeType';
import { translate } from '../translate/translate';
import {
LOGIN,
ACTIVE_HANDLE
} from '../storeType';
import { translate } from '../../translate/translate';
import {
triggerToaster,
Config,
getMainAddressState,
updateErrosStack
} from './actionCreators';
} from '../actionCreators';
import {
logGuiHttp,
guiLogState
@ -196,14 +199,14 @@ function iguanaWalletPassphraseState(json, dispatch) {
dispatch(iguanaActiveHandleState(json));
return {
type: storeType.LOGIN,
type: LOGIN,
isLoggedIn: json && json.pubkey ? true : false,
}
}
function iguanaActiveHandleState(json) {
return {
type: storeType.ACTIVE_HANDLE,
type: ACTIVE_HANDLE,
isLoggedIn: sessionStorage.getItem('IguanaActiveAccount') && JSON.parse(sessionStorage.getItem('IguanaActiveAccount')).pubkey === json.pubkey && json.status === 'unlocked' ? true : false,
handle: json,
}
Loading…
Cancel
Save