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.
55 lines
1.2 KiB
55 lines
1.2 KiB
/* @flow */
|
|
'use strict';
|
|
|
|
import * as RECEIVE from '../actions/constants/receive';
|
|
|
|
export type State = {
|
|
+deviceState: ?string;
|
|
+deviceId: ?string;
|
|
+deviceInstance: ?string;
|
|
+accountIndex: ?number;
|
|
+network: ?string;
|
|
location: string;
|
|
addressVerified: boolean;
|
|
adressUnverified: boolean;
|
|
}
|
|
|
|
export const initialState: State = {
|
|
deviceState: null,
|
|
deviceId: null,
|
|
deviceInstance: null,
|
|
accountIndex: null,
|
|
network: null,
|
|
location: '',
|
|
addressVerified: false,
|
|
addressUnverified: false,
|
|
};
|
|
|
|
export default (state: State = initialState, action: any): State => {
|
|
|
|
switch (action.type) {
|
|
|
|
case RECEIVE.INIT :
|
|
return action.state;
|
|
|
|
case RECEIVE.DISPOSE :
|
|
return initialState;
|
|
|
|
case RECEIVE.SHOW_ADDRESS :
|
|
return {
|
|
...state,
|
|
addressVerified: true,
|
|
addressUnverified: false
|
|
}
|
|
case RECEIVE.SHOW_UNVERIFIED_ADDRESS :
|
|
return {
|
|
...state,
|
|
addressVerified: false,
|
|
addressUnverified: true
|
|
}
|
|
|
|
default:
|
|
return state;
|
|
}
|
|
|
|
} |