Skip to content

Commit

Permalink
fix: keep fields order again
Browse files Browse the repository at this point in the history
  • Loading branch information
awesthouse committed Mar 11, 2024
1 parent 7a7fba9 commit 6f48b21
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ export const AttributeList = (props: {

const hideByDefaultFields: string[] = ['type', '_meta_']
const filteredAttributes =
Array.isArray(config.fields) && config.fields.length > 0
? attributes.filter((attr) => config.fields.includes(attr.name))
Array.isArray(config.fields) && config.fields.length
? config.fields
.map((field) =>
attributes?.find((attribute) => attribute.name === field)
)
.filter((attribute): attribute is TAttribute => !!attribute)
: attributes.filter((attr) => !hideByDefaultFields.includes(attr.name))

return (
Expand Down

0 comments on commit 6f48b21

Please sign in to comment.