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.

actions.native.js 646B

12345678910111213141516171819202122232425262728
  1. // @flow
  2. import type { Dispatch } from 'redux';
  3. import { TOGGLE_TOOLBOX_VISIBLE } from './actionTypes';
  4. export * from './actions.any';
  5. /**
  6. * Action to toggle the toolbox visibility.
  7. *
  8. * @returns {Function}
  9. */
  10. export function toggleToolboxVisible() {
  11. return (dispatch: Dispatch<any>, getState: Function) => {
  12. const state = getState();
  13. const { toolbarConfig: { alwaysVisible } } = state['features/base/config'];
  14. const { visible } = state['features/toolbox'];
  15. if (visible && alwaysVisible) {
  16. return;
  17. }
  18. dispatch({
  19. type: TOGGLE_TOOLBOX_VISIBLE
  20. });
  21. };
  22. }