Make sure community index filters on value array, not object

(closes #6092)

This is breakage related to #6087 in replacing lodash `_.filter`
(which can iterate (v,k) over an object) with `Array.filter`
This commit is contained in:
Bryan Housel
2019-03-27 09:32:31 -04:00
parent 7f56a34b16
commit 710966801f
+2 -3
View File
@@ -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