2018-04-14 00:00:40 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import { MiddlewareRegistry } from '../base/redux';
|
|
|
|
|
|
|
|
import { OPEN_DESKTOP_APP } from './actionTypes';
|
|
|
|
import { openDesktopApp } from './functions';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements the middleware of the deep linking feature.
|
|
|
|
*
|
|
|
|
* @param {Store} store - The redux store.
|
|
|
|
* @returns {Function}
|
|
|
|
*/
|
|
|
|
MiddlewareRegistry.register(store => next => action => {
|
|
|
|
switch (action.type) {
|
|
|
|
case OPEN_DESKTOP_APP:
|
2019-06-07 13:06:52 +00:00
|
|
|
openDesktopApp(store.getState());
|
2018-04-14 00:00:40 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return next(action);
|
|
|
|
});
|