Skip to content

Commit

Permalink
Add a comment about side-effects
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed Oct 8, 2021
1 parent a22eead commit be9ef0c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/SearchBlock/SearchBlockView.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import config from '@plone/volto/registry';
// import { cloneDeep } from 'lodash';
import { SearchApp } from '@eeacms/search';
import { SearchBlockSchema } from './schema';

Expand All @@ -18,6 +19,10 @@ import './styles.less';
*/
const applyBlockSettings = (config, appName, data, schema) => {
// apply mutations inline to the config

// config = cloneDeep(config);
// TODO: this has the side-effect that it mutates the global config
// Viewing this block will also "fix" the global config for the middleware
const settings = config.searchui[appName];
Object.keys(data).forEach((fieldName) => {
const field = schema.properties[fieldName];
Expand Down

0 comments on commit be9ef0c

Please sign in to comment.