Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(clearRefinements): do not throw when widgetParams is not given #4778

Merged
merged 3 commits into from
Jun 15, 2021

Conversation

eunjae-lee
Copy link
Contributor

Summary

This PR prevents connectClearRefinement from throwing an error when widgetParams is not given.
When it's used with the official clearRefinement widget, then normally at least container is there, but if it's used in a custom widget or in Vue InstantSearch, there could be no widgetParams at all.

Verified

This commit was signed with the committer’s verified signature.
edolstra Eelco Dolstra
@eunjae-lee eunjae-lee requested review from a team, tkrugg and francoischalifour and removed request for a team June 11, 2021 13:32
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 11, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ec8753e:

Sandbox Source
InstantSearch.js Configuration

@eunjae-lee eunjae-lee requested a review from Haroenv June 14, 2021 08:41
Co-authored-by: Haroen Viaene <hello@haroen.me>
@Haroenv
Copy link
Contributor

Haroenv commented Jun 14, 2021

Vue InstantSearch

Doesn't Vue InstantSearch always at least give an empty object since it's calculated from props? This PR still makes sense, but I'm not sure whether Vue InstantSearch is relevant

@eunjae-lee
Copy link
Contributor Author

Vue InstantSearch

Doesn't Vue InstantSearch always at least give an empty object since it's calculated from props? This PR still makes sense, but I'm not sure whether Vue InstantSearch is relevant

Our official widgets provide an empty object, but if it's a custom widget and the one who made the widget didn't provide an empty object, it will fail, which was the case in the e-commerce demo in Vue InstantSearch.

@eunjae-lee eunjae-lee merged commit 6b1a375 into master Jun 15, 2021
@eunjae-lee eunjae-lee deleted the fix/clear-refinements-widgetparams branch June 15, 2021 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants