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.
36 lines
754 B
36 lines
754 B
/* @flow */
|
|
'use strict';
|
|
|
|
import * as ACCOUNT from '../actions/constants/account';
|
|
import * as CONNECT from '../actions/constants/TrezorConnect';
|
|
|
|
import type { Action } from '~/flowtype';
|
|
import type { Coin } from './LocalStorageReducer';
|
|
|
|
export type State = {
|
|
+index: number;
|
|
+deviceState: string;
|
|
+deviceId: string;
|
|
+deviceInstance: ?number;
|
|
+network: string;
|
|
+coin: Coin;
|
|
+location: string;
|
|
};
|
|
|
|
export const initialState: ?State = null;
|
|
|
|
export default (state: ?State = initialState, action: Action): ?State => {
|
|
|
|
switch (action.type) {
|
|
|
|
case ACCOUNT.INIT :
|
|
return action.state;
|
|
|
|
case ACCOUNT.DISPOSE :
|
|
return initialState;
|
|
|
|
default:
|
|
return state;
|
|
}
|
|
|
|
} |