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

middleware.any.ts 827B

1234567891011121314151617181920212223242526272829
  1. import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
  2. import { SET_DYNAMIC_BRANDING_DATA } from './actionTypes';
  3. import { fetchCustomIcons } from './functions.any';
  4. import logger from './logger';
  5. MiddlewareRegistry.register(() => next => action => {
  6. switch (action.type) {
  7. case SET_DYNAMIC_BRANDING_DATA: {
  8. const { customIcons } = action.value;
  9. if (customIcons) {
  10. fetchCustomIcons(customIcons)
  11. .then(localCustomIcons => {
  12. action.value.brandedIcons = localCustomIcons;
  13. return next(action);
  14. })
  15. .catch((error: any) => {
  16. logger.error('Error fetching branded custom icons:', error);
  17. });
  18. }
  19. break;
  20. }
  21. }
  22. return next(action);
  23. });