mirror of https://github.com/trezor/trezor-wallet
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.
38 lines
736 B
38 lines
736 B
/* @flow */
|
|
import * as ACCOUNT from 'actions/constants/account';
|
|
|
|
import type {
|
|
Action,
|
|
Account,
|
|
Coin,
|
|
Token,
|
|
PendingTx,
|
|
Discovery,
|
|
} from 'flowtype';
|
|
|
|
export type State = {
|
|
location?: string;
|
|
account: ?Account;
|
|
network: ?Coin;
|
|
tokens: Array<Token>,
|
|
pending: Array<PendingTx>,
|
|
discovery: ?Discovery
|
|
};
|
|
|
|
export const initialState: State = {
|
|
location: '/',
|
|
account: null,
|
|
network: null,
|
|
tokens: [],
|
|
pending: [],
|
|
discovery: null,
|
|
};
|
|
|
|
export default (state: State = initialState, action: Action): State => {
|
|
switch (action.type) {
|
|
case ACCOUNT.UPDATE_SELECTED_ACCOUNT:
|
|
return action.payload;
|
|
default:
|
|
return state;
|
|
}
|
|
}; |