Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

middleware.js 688B

1234567891011121314151617181920212223242526272829303132
  1. // @flow
  2. import { MiddlewareRegistry } from '../base/redux';
  3. import { CLOSE_PANEL, TOGGLE_CHAT } from './actionTypes';
  4. declare var APP: Object;
  5. /**
  6. * Middleware that catches actions related to the non-reactified web side panel.
  7. *
  8. * @param {Store} store - Redux store.
  9. * @returns {Function}
  10. */
  11. // eslint-disable-next-line no-unused-vars
  12. MiddlewareRegistry.register(store => next => action => {
  13. if (typeof APP !== 'object') {
  14. return next(action);
  15. }
  16. switch (action.type) {
  17. case CLOSE_PANEL:
  18. APP.UI.toggleSidePanel(action.current);
  19. break;
  20. case TOGGLE_CHAT:
  21. APP.UI.toggleChat();
  22. break;
  23. }
  24. return next(action);
  25. });