2020-04-16 11:26:44 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import { ReducerRegistry } from '../base/redux';
|
|
|
|
|
2020-05-07 09:54:02 +00:00
|
|
|
import { TOGGLE_E2EE } from './actionTypes';
|
2020-04-16 11:26:44 +00:00
|
|
|
|
|
|
|
const DEFAULT_STATE = {
|
2020-05-07 09:54:02 +00:00
|
|
|
enabled: false
|
2020-04-16 11:26:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reduces the Redux actions of the feature features/e2ee.
|
|
|
|
*/
|
|
|
|
ReducerRegistry.register('features/e2ee', (state = DEFAULT_STATE, action) => {
|
|
|
|
switch (action.type) {
|
2020-05-07 09:54:02 +00:00
|
|
|
case TOGGLE_E2EE:
|
2020-04-16 11:26:44 +00:00
|
|
|
return {
|
|
|
|
...state,
|
2020-05-07 09:54:02 +00:00
|
|
|
enabled: action.enabled
|
2020-04-16 11:26:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
});
|