Skip to content

Commit

Permalink
Make sure community index filters on value array, not object
Browse files Browse the repository at this point in the history
(closes #6092)

This is breakage related to #6087 in replacing lodash `_.filter`
(which can iterate (v,k) over an object) with `Array.filter`
  • Loading branch information
bhousel committed Mar 27, 2019
1 parent 7f56a34 commit 7109668
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions modules/ui/success.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,8 @@ export function uiSuccess(context) {
var matchIDs = matchFeatures.map(function(feature) { return feature.id; });

// Gather community resources that are either global or match a polygon.
var matchResources = data.community.resources.filter(function(v) {
return !v.featureId || matchIDs.indexOf(v.featureId) !== -1;
});
var matchResources = Object.values(data.community.resources)
.filter(function(v) { return !v.featureId || matchIDs.indexOf(v.featureId) !== -1; });

if (matchResources.length) {
// sort by size ascending, then by community rank
Expand Down

0 comments on commit 7109668

Please sign in to comment.