您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

reducer.js 838B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // @flow
  2. import { ReducerRegistry } from '../base/redux';
  3. import {
  4. SET_EVERYONE_ENABLED_E2EE,
  5. SET_EVERYONE_SUPPORT_E2EE,
  6. TOGGLE_E2EE
  7. } from './actionTypes';
  8. const DEFAULT_STATE = {
  9. enabled: false
  10. };
  11. /**
  12. * Reduces the Redux actions of the feature features/e2ee.
  13. */
  14. ReducerRegistry.register('features/e2ee', (state = DEFAULT_STATE, action) => {
  15. switch (action.type) {
  16. case TOGGLE_E2EE:
  17. return {
  18. ...state,
  19. enabled: action.enabled
  20. };
  21. case SET_EVERYONE_ENABLED_E2EE:
  22. return {
  23. ...state,
  24. everyoneEnabledE2EE: action.everyoneEnabledE2EE
  25. };
  26. case SET_EVERYONE_SUPPORT_E2EE:
  27. return {
  28. ...state,
  29. everyoneSupportE2EE: action.everyoneSupportE2EE
  30. };
  31. default:
  32. return state;
  33. }
  34. });