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.
trezor-wallet/src/js/reducers/SummaryReducer.js

51 lines
944 B

/* @flow */
'use strict';
import * as SUMMARY from '../actions/constants/summary';
export type State = {
+deviceState: ?string;
+deviceId: ?string;
+deviceInstance: ?string;
+accountIndex: ?number;
+network: ?string;
location: string;
details: boolean;
selectedToken: any;
}
export const initialState: State = {
deviceState: null,
deviceId: null,
deviceInstance: 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;
}
}