Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"@emotion/react": "^11.10.6",
"@emotion/styled": "^11.10.6",
"react-i18next": "^13.0.0 || ^14.0.0 || ^15.0.0",
"lodash": "^4.17.11",
"mirador": "^4.0.0-alpha.17",
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
Expand All @@ -54,7 +53,6 @@
"eslint-plugin-testing-library": "^6.2.0",
"glob": "^10.3.0",
"happy-dom": "^17.0.0",
"lodash": "^4.17.15",
"mirador": "^4.0.0-alpha.17",
"react": "^19.0.0",
"react-dom": "^19.0.0",
Expand Down
12 changes: 7 additions & 5 deletions src/CanvasDownloadLinks.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Component } from 'react';
import PropTypes from 'prop-types';
import uniqBy from 'lodash/uniqBy';
import { OSDReferences } from 'mirador';
import Typography from '@mui/material/Typography';
import Link from '@mui/material/Link';
Expand Down Expand Up @@ -120,10 +119,13 @@ export default class CanvasDownloadLinks extends Component {
const { infoResponse } = this.props;
if (!(infoResponse && infoResponse.json && infoResponse.json.sizes)) return [];

return uniqBy(
infoResponse.json.sizes,
(size) => `${size.width}${size.height}`,
);
const sizeMap = new Map();
return infoResponse.json.sizes.filter((size) => {
const key = `${size.width}${size.height}`;
if (sizeMap.has(key)) return false;
sizeMap.set(key, true);
return true;
});
}

fullImageLink() {
Expand Down