1
0
mirror of https://github.com/trezor/trezor-wallet synced 2025-07-12 09:38:09 +00:00
trezor-wallet/src/js/reducers/AbstractAccountReducer.js
2018-04-11 15:21:43 +02:00

41 lines
756 B
JavaScript

/* @flow */
'use strict';
import * as ACCOUNT from '../actions/constants/account';
import * as CONNECT from '../actions/constants/TrezorConnect';
export type State = {
+index: number;
+deviceState: ?string;
+deviceId: ?string;
+deviceInstance: ?string;
+network: string;
location: string;
}
export const initialState: State = {
index: 0,
deviceState: null,
deviceId: null,
deviceInstance: null,
network: '',
location: '',
};
export default (state: State = initialState, action: any): State => {
switch (action.type) {
case ACCOUNT.INIT :
return action.state;
case ACCOUNT.DISPOSE :
return initialState;
default:
return state;
}
}