mirror of
https://github.com/wassname/talk.git
synced 2026-07-06 05:17:19 +08:00
Adding deprecation notice
This commit is contained in:
@@ -465,7 +465,7 @@ const mapStateToProps = state => ({
|
||||
activeStreamTab: state.stream.activeTab,
|
||||
previousStreamTab: state.stream.previousTab,
|
||||
commentClassNames: state.stream.commentClassNames,
|
||||
pluginsConfig: state.config.plugins_config,
|
||||
pluginsConfig: state.config.plugins_config || state.config.plugin_config,
|
||||
sortOrder: state.stream.sortOrder,
|
||||
sortBy: state.stream.sortBy,
|
||||
});
|
||||
|
||||
@@ -72,8 +72,18 @@ class Slot extends React.Component {
|
||||
} = this.props;
|
||||
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') || emptyConfig;
|
||||
get(reduxState, 'config.plugins_config') ||
|
||||
get(reduxState, 'config.plugin_config') ||
|
||||
emptyConfig;
|
||||
|
||||
if (children.length === 0 && DefaultComponent) {
|
||||
const props = plugins.getSlotComponentProps(
|
||||
DefaultComponent,
|
||||
|
||||
@@ -84,8 +84,16 @@ class PluginsService {
|
||||
* query datas are only passed to the component if it is defined in `component.fragments`.
|
||||
*/
|
||||
getSlotComponentProps(component, reduxState, props, queryData) {
|
||||
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') || emptyConfig;
|
||||
get(reduxState, 'config.plugins_config') ||
|
||||
get(reduxState, 'config.plugin_config') ||
|
||||
emptyConfig;
|
||||
return {
|
||||
...props,
|
||||
config: pluginsConfig,
|
||||
|
||||
Reference in New Issue
Block a user