show dep message only once

This commit is contained in:
okbel
2018-03-14 23:33:06 -03:00
parent fb519286c3
commit 7d7e3f60d3
2 changed files with 7 additions and 7 deletions
@@ -73,12 +73,6 @@ class Slot extends React.Component {
const { plugins } = this.context;
let children = this.getChildren();
if (!!get(reduxState, 'config.plugin_config')) {
console.warn(
`deprecation warning: config.plugin_config will be phased out soon, please replace calls from config.plugin_config to config.plugins_config`
);
}
const pluginsConfig =
get(reduxState, 'config.plugins_config') ||
get(reduxState, 'config.plugin_config') ||
+7 -1
View File
@@ -83,11 +83,17 @@ class PluginsService {
* getSlotComponentProps calculate the props we would pass to the slot component.
* query datas are only passed to the component if it is defined in `component.fragments`.
*/
showPluginsConfigWarning = true;
getSlotComponentProps(component, reduxState, props, queryData) {
if (!!get(reduxState, 'config.plugin_config')) {
if (
!!get(reduxState, 'config.plugin_config') &&
this.showPluginsConfigWarning
) {
console.warn(
`deprecation warning: config.plugin_config will be phased out soon, please replace calls from config.plugin_config to config.plugins_config`
);
this.showPluginsConfigWarning = false;
}
const pluginsConfig =