mirror of
https://github.com/trezor/trezor-wallet
synced 2025-02-01 02:41:01 +00:00
43 lines
913 B
JavaScript
43 lines
913 B
JavaScript
|
/* @flow */
|
||
|
'use strict';
|
||
|
|
||
|
import * as RECEIVE from '../actions/constants/receive';
|
||
|
|
||
|
export type State = {
|
||
|
addressVerified: boolean;
|
||
|
adressUnverified: boolean;
|
||
|
}
|
||
|
|
||
|
export const initialState: State = {
|
||
|
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;
|
||
|
}
|
||
|
|
||
|
}
|