Skip to content

Commit

Permalink
remove duplicated formats
Browse files Browse the repository at this point in the history
  • Loading branch information
zotya committed Mar 14, 2023
1 parent 3d9c842 commit 675a203
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/components/ItemView/Datasets.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,20 +341,25 @@ const Datasets = (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 675a203

Please sign in to comment.