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(sffv): no error when not providing noResults and no results #2310

Merged
merged 1 commit into from
Sep 5, 2017

Conversation

bobylito
Copy link
Contributor

@bobylito bobylito commented Sep 5, 2017

When there was no results and the template is not provided, is.js would trigger an error.

Fix #2087

When there was no results and the template is not provided, is.js would
trigger an error.

Fix #2087
@bobylito bobylito requested review from vvo and Haroenv September 5, 2017 13:28
@algobot
Copy link
Contributor

algobot commented Sep 5, 2017

Deploy preview ready!

Built with commit ba56d0b

https://deploy-preview-2310--algolia-instantsearch.netlify.com

Copy link
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change, wondering a bit about the code

@@ -253,7 +254,7 @@ export default function refinementList(
? prefixKeys('show-more-', showMoreConfig.templates)
: {};
const searchForValuesTemplates = searchForFacetValues
? searchForFacetValues.templates
? searchForFacetValues.templates || sffvDefaultTemplates
: {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition seems a bit complex to me. I'm wondering if something like this is more straightforward:

const searchForValuesTemplates = searchForFacetValues
  ? searchForFacetValues.templates
    ? searchForFacetValues.templates
    : sffvDefaultTemplates
  : {};

It's still a double ternary, but this might be easier to read.

@bobylito bobylito merged commit cc02b71 into develop Sep 5, 2017
@bobylito bobylito deleted the fix/2087 branch September 5, 2017 14:05
bobylito pushed a commit that referenced this pull request Sep 5, 2017
<a name=2.1.3></a>
## [2.1.3](v2.1.2...v2.1.3) (2017-09-05)

### Bug Fixes

* **Pagination:** add  to <Pagination /> ([#2296](#2296)) ([545f076](545f076))
* **sffv:** no error when not providing noResults and no results ([#2310](#2310)) ([cc02b71](cc02b71)), closes [#2087](#2087)
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.

3 participants