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

middleware.web.ts 757B

123456789101112131415161718192021222324252627
  1. import { APP_WILL_MOUNT } from '../base/app/actionTypes';
  2. import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
  3. import { SET_DYNAMIC_BRANDING_DATA } from './actionTypes';
  4. import { fetchCustomBrandingData } from './actions.any';
  5. import { createMuiBrandingTheme } from './functions.web';
  6. import './middleware.any';
  7. MiddlewareRegistry.register(store => next => action => {
  8. switch (action.type) {
  9. case APP_WILL_MOUNT: {
  10. store.dispatch(fetchCustomBrandingData());
  11. break;
  12. }
  13. case SET_DYNAMIC_BRANDING_DATA: {
  14. const { customTheme } = action.value;
  15. if (customTheme) {
  16. action.value.muiBrandedTheme = createMuiBrandingTheme(customTheme);
  17. }
  18. }
  19. }
  20. return next(action);
  21. });