eslint ./src/reducers

pull/86/head
Szymon Lesisz 6 years ago
parent de7e8914cb
commit d684eec819

@ -45,7 +45,7 @@ const createAccount = (state: State, account: Account): State => {
if (exist) { if (exist) {
return state; return state;
} }
const newState: State = [ ...state ]; const newState: State = [...state];
newState.push(account); newState.push(account);
return newState; return newState;
}; };
@ -66,7 +66,7 @@ const updateAccount = (state: State, account: Account): State => {
const newState: State = [...state]; const newState: State = [...state];
newState[index] = account; newState[index] = account;
return newState; return newState;
} };
const setBalance = (state: State, action: AccountSetBalanceAction): State => { const setBalance = (state: State, action: AccountSetBalanceAction): State => {
// const index: number = state.findIndex(account => account.address === action.address && account.network === action.network && account.deviceState === action.deviceState); // const index: number = state.findIndex(account => account.address === action.address && account.network === action.network && account.deviceState === action.deviceState);
@ -100,7 +100,7 @@ export default (state: State = initialState, action: Action): State => {
//case CONNECT.FORGET_SINGLE : //case CONNECT.FORGET_SINGLE :
// return forgetAccounts(state, action); // return forgetAccounts(state, action);
case ACCOUNT.UPDATE : case ACCOUNT.UPDATE:
return updateAccount(state, action.payload); return updateAccount(state, action.payload);
case ACCOUNT.SET_BALANCE: case ACCOUNT.SET_BALANCE:

@ -1,6 +1,5 @@
/* @flow */ /* @flow */
import { RATE_UPDATE } from 'services/CoinmarketcapService'; import { RATE_UPDATE } from 'services/CoinmarketcapService';
import type { Action } from 'flowtype'; import type { Action } from 'flowtype';
@ -27,7 +26,6 @@ const update = (state: Array<Fiat>, action: FiatRateAction): Array<Fiat> => {
return newState; return newState;
}; };
export default (state: Array<Fiat> = initialState, action: Action): Array<Fiat> => { export default (state: Array<Fiat> = initialState, action: Action): Array<Fiat> => {
switch (action.type) { switch (action.type) {
case RATE_UPDATE: case RATE_UPDATE:

@ -94,7 +94,6 @@ export default function modal(state: State = initialState, action: Action): Stat
case UI.CLOSE_UI_WINDOW: case UI.CLOSE_UI_WINDOW:
case MODAL.CLOSE: case MODAL.CLOSE:
case CONNECT.FORGET: case CONNECT.FORGET:
case CONNECT.FORGET_SINGLE: case CONNECT.FORGET_SINGLE:
case CONNECT.REMEMBER: case CONNECT.REMEMBER:

@ -39,11 +39,13 @@ const add = (state: State, action: SendTxAction): State => {
return newState; return newState;
}; };
const add_NEW = (state: State, payload: any): State => { /*
const addFromBloockbokNotifiaction = (state: State, payload: any): State => {
const newState = [...state]; const newState = [...state];
newState.push(payload); newState.push(payload);
return newState; return newState;
}; };
*/
const remove = (state: State, id: string): State => state.filter(tx => tx.id !== id); const remove = (state: State, id: string): State => state.filter(tx => tx.id !== id);

@ -4,7 +4,6 @@
import Web3 from 'web3'; import Web3 from 'web3';
import type { Contract } from 'web3'; import type { Contract } from 'web3';
import * as STORAGE from 'actions/constants/localStorage';
import * as WEB3 from 'actions/constants/web3'; import * as WEB3 from 'actions/constants/web3';
import type { Action } from 'flowtype'; import type { Action } from 'flowtype';

@ -40,7 +40,7 @@ const reducers = {
fiat, fiat,
wallet, wallet,
devices, devices,
blockchain blockchain,
}; };
export type Reducers = typeof reducers; export type Reducers = typeof reducers;

Loading…
Cancel
Save