Skip to content

Commit

Permalink
fix(connectConfigure): ensure we do not extend SearchParameters (#2945
Browse files Browse the repository at this point in the history
)

This was firing requests to Algolia with all the functions from the SearchParameters base class.
  • Loading branch information
Maxime Janton authored and bobylito committed May 29, 2018
1 parent bbf9f8f commit fdb4a7a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/connectors/configure/connectConfigure.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,12 @@ export default function connectConfigure(renderFn, unmountFn) {
return searchParameters => {
// merge new `searchParameters` with the ones set from other widgets
const actualState = this.removeSearchParameters(helper.getState());
const nextSearchParameters = enhanceConfiguration({})(actualState, {
getConfiguration: () => searchParameters,
});
const nextSearchParameters = enhanceConfiguration({})(
{ ...actualState },
{
getConfiguration: () => searchParameters,
}
);

// trigger a search with the new merged searchParameters
helper.setState(nextSearchParameters).search();
Expand Down

0 comments on commit fdb4a7a

Please sign in to comment.