2022-11-23 09:12:26 +00:00
|
|
|
import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
|
2018-03-07 00:28:19 +00:00
|
|
|
|
|
|
|
import { OPEN_KEYBOARD_SHORTCUTS_DIALOG } from './actionTypes';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements the middleware of the feature keyboard-shortcuts.
|
|
|
|
*
|
|
|
|
* @param {Store} store - The redux store.
|
|
|
|
* @returns {Function}
|
|
|
|
*/
|
2022-11-23 09:12:26 +00:00
|
|
|
MiddlewareRegistry.register(_store => next => action => {
|
2018-03-07 00:28:19 +00:00
|
|
|
switch (action.type) {
|
|
|
|
case OPEN_KEYBOARD_SHORTCUTS_DIALOG:
|
|
|
|
if (typeof APP === 'object') {
|
|
|
|
APP.keyboardshortcut.openDialog();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return next(action);
|
|
|
|
});
|