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.
47 lines
844 B
47 lines
844 B
/* @flow */
|
|
'use strict';
|
|
|
|
import * as SUMMARY from '../actions/constants/summary';
|
|
|
|
export type State = {
|
|
+deviceState: ?string;
|
|
+accountIndex: ?number;
|
|
+network: ?string;
|
|
location: string;
|
|
|
|
details: boolean;
|
|
selectedToken: any;
|
|
}
|
|
|
|
export const initialState: State = {
|
|
deviceState: null,
|
|
accountIndex: null,
|
|
network: null,
|
|
location: '',
|
|
|
|
details: true,
|
|
selectedToken: null
|
|
};
|
|
|
|
|
|
export default (state: State = initialState, action: any): State => {
|
|
|
|
switch (action.type) {
|
|
|
|
case SUMMARY.INIT :
|
|
return action.state;
|
|
|
|
case SUMMARY.DISPOSE :
|
|
return initialState;
|
|
|
|
case SUMMARY.DETAILS_TOGGLE :
|
|
return {
|
|
...state,
|
|
details: !state.details
|
|
}
|
|
|
|
default:
|
|
return state;
|
|
}
|
|
|
|
} |