You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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. });