Skip to content

Commit

Permalink
fix: Don't show preset fields in "additional fields"
Browse files Browse the repository at this point in the history
  • Loading branch information
gmaclennan committed Oct 6, 2019
1 parent 8051235 commit 9170100
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/ViewWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,15 @@ const WrappedMapView = ({
additionalFields: defaultPreset.additionalFields.filter(
// Any fields that are not defined in the preset we show as 'additionalFields'
additionalField => {
return !preset.fields.find(field =>
isEqual(field.key, additionalField.key)
)
return !preset.fields.find(field => {
const fieldKey = Array.isArray(field.key)
? field.key
: [field.key]
const additionalFieldKey = Array.isArray(additionalField.key)
? additionalField.key
: [additionalField.key]
return isEqual(fieldKey, additionalFieldKey)
})
}
)
}
Expand Down

0 comments on commit 9170100

Please sign in to comment.