Saúl Ibarra Corretgé cb6fbb0f03 e2ee: add UI elements
* Add dialog to set the E2EE key
* Use the Redux action / middleware to update the key even when set through the
  hash parameter
* Cleanup URL after processing the key so it's not recorded in browser history
2020-04-16 20:25:56 +02:00

30 lines
516 B
JavaScript

// @flow
import { ReducerRegistry } from '../base/redux';
import { SET_E2EE_KEY } from './actionTypes';
const DEFAULT_STATE = {
/**
* E2EE key.
*/
e2eeKey: undefined
};
/**
* Reduces the Redux actions of the feature features/e2ee.
*/
ReducerRegistry.register('features/e2ee', (state = DEFAULT_STATE, action) => {
switch (action.type) {
case SET_E2EE_KEY:
return {
...state,
e2eeKey: action.key
};
default:
return state;
}
});