Skip to content

Commit

Permalink
removed duplicated formats
Browse files Browse the repository at this point in the history
  • Loading branch information
zotya committed Mar 14, 2023
1 parent 7762336 commit eefe941
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/components/ItemView/Datasets/DatasetItemsList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,21 @@ const DatasetItemsList = (props) => {
<span className="dataset-title">
{dataset.resourceTitleObject.default}
<span className="formats">
{(dataset.format || []).map((item, i) => {
return (
<span className="format-label" key={i}>
{item}
</span>
);
})}
{(dataset.format || [])
.filter((item, pos, self) => self.indexOf(item) === pos)
.map((item, i) => {
return (
<span className="format-label" key={i}>
{item}
</span>
);
})}

{Array.isArray(dataset.linkProtocol) ? (
<>
{dataset.linkProtocol
.filter((i) => i.includes('ESRI') || i.includes('OGC'))
.filter((item, pos, self) => self.indexOf(item) === pos)
.map((item, i) => {
return (
<span className="format-label" key={i}>
Expand Down

0 comments on commit eefe941

Please sign in to comment.