Skip to content

Commit

Permalink
fix(menu): send an empty array values when no values
Browse files Browse the repository at this point in the history
fixes #107
  • Loading branch information
vvo committed Sep 22, 2015
1 parent 31e4a80 commit 12cd7dc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions widgets/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ function toggleRefinement(helper, facetName, facetValue) {
}

function getFacetValues(results, hierarchicalFacetName, sortBy, limit) {
return results
.getFacetValues(hierarchicalFacetName, {sortBy: sortBy})
.data.slice(0, limit);
var values = results
.getFacetValues(hierarchicalFacetName, {sortBy: sortBy});

return values.data && values.data.slice(0, limit) || [];
}

module.exports = menu;

0 comments on commit 12cd7dc

Please sign in to comment.