|
|
|
|
@ -8,7 +8,8 @@ import PluginChecker from 'utils/plugin-checker';
|
|
|
|
|
|
|
|
|
|
export enum PluginsActionTypes {
|
|
|
|
|
CHECK_PLUGINS = 'CHECK_PLUGINS',
|
|
|
|
|
CHECKED_ALL_PLUGINS = 'CHECKED_ALL_PLUGINS'
|
|
|
|
|
CHECKED_ALL_PLUGINS = 'CHECKED_ALL_PLUGINS',
|
|
|
|
|
RAISE_PLUGIN_CHECK_ERROR = 'RAISE_PLUGIN_CHECK_ERROR'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type PluginObjects = Record<SupportedPlugins, boolean>;
|
|
|
|
|
@ -20,6 +21,11 @@ const pluginActions = {
|
|
|
|
|
list,
|
|
|
|
|
})
|
|
|
|
|
),
|
|
|
|
|
raisePluginCheckError: (error: Error) => (
|
|
|
|
|
createAction(PluginsActionTypes.RAISE_PLUGIN_CHECK_ERROR, {
|
|
|
|
|
error,
|
|
|
|
|
})
|
|
|
|
|
),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type PluginActions = ActionUnion<typeof pluginActions>;
|
|
|
|
|
@ -39,9 +45,13 @@ export function checkPluginsAsync(): ThunkAction {
|
|
|
|
|
PluginChecker.check(SupportedPlugins.DEXTR_SEGMENTATION),
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const values = await Promise.all(promises);
|
|
|
|
|
[plugins.ANALYTICS, plugins.GIT_INTEGRATION,
|
|
|
|
|
plugins.DEXTR_SEGMENTATION] = values;
|
|
|
|
|
dispatch(pluginActions.checkedAllPlugins(plugins));
|
|
|
|
|
try {
|
|
|
|
|
const values = await Promise.all(promises);
|
|
|
|
|
[plugins.ANALYTICS, plugins.GIT_INTEGRATION,
|
|
|
|
|
plugins.DEXTR_SEGMENTATION] = values;
|
|
|
|
|
dispatch(pluginActions.checkedAllPlugins(plugins));
|
|
|
|
|
} catch (error) {
|
|
|
|
|
dispatch(pluginActions.raisePluginCheckError(error));
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|