Skip to content

Commit 858b489

Browse files
committed
COLUMBIA: mirador-downloaddialog - imageServicesFrom expects a list
- CanvasDownloadLinks.js correctly identifies image canvases - rename mirador-downloaddialog components to jsx
1 parent 287aafb commit 858b489

File tree

7 files changed

+3
-3
lines changed

7 files changed

+3
-3
lines changed

src/culPlugins/mirador-downloaddialog/components/dialog/CanvasDownloadLinks.js renamed to src/culPlugins/mirador-downloaddialog/components/dialog/CanvasDownloadLinks.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import { useTheme } from '@mui/material/styles';
88
import Typography from '@mui/material/Typography';
99
import PropTypes from 'prop-types';
1010

11-
import { imageServicesFrom } from '../../../../lib/resourceFilters';
11+
import { iiifImageResourcesFrom } from '../../../../lib/resourceFilters';
1212

1313
import ImageDownloadLinks from './ImageDownloadLinks';
1414
import SuppressedDownload from './SuppressedDownload';
1515

1616
/**
1717
* Filter the misnamed imageResources property to actual imageResources
1818
*/
19-
const anyImageResources = (imageResources) => (imageResources || []).filter((r) => imageServicesFrom(r).length > 0);
19+
const anyImageResources = (resources) => (resources || []).filter((r) => iiifImageResourcesFrom([r]).length > 0);
2020

2121
/** */
2222
const CanvasDownloadLinks = ({
@@ -30,7 +30,7 @@ const CanvasDownloadLinks = ({
3030
);
3131
}
3232

33-
if (anyImageResources(canvas?.imageResources).length > 0) {
33+
if (canvas && anyImageResources(canvas.imageResources).length > 0) {
3434
return (
3535
<ImageDownloadLinks
3636
canvas={canvas}

0 commit comments

Comments
 (0)