You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-wallet/src/reducers/SelectedAccountReducer.js

44 lines
798 B

/* @flow */
import * as ACCOUNT from 'actions/constants/account';
import type {
Action,
Account,
Coin,
Token,
PendingTx,
Discovery,
Web3Instance,
} from 'flowtype';
export type State = {
location?: string;
account: ?Account;
network: ?Coin;
tokens: Array<Token>,
pending: Array<PendingTx>,
web3: ?Web3Instance,
discovery: ?Discovery
};
export const initialState: State = {
location: '/',
account: null,
network: null,
tokens: [],
pending: [],
web3: null,
discovery: null,
};
export default (state: State = initialState, action: Action): State => {
switch (action.type) {
case ACCOUNT.UPDATE_SELECTED_ACCOUNT:
return action.payload;
default:
return state;
}
};