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

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