diff --git a/src/components/collection-explorer/work-viewer/ImageWorkViewer.tsx b/src/components/collection-explorer/work-viewer/ImageWorkViewer.tsx index bb12cea..4457a94 100644 --- a/src/components/collection-explorer/work-viewer/ImageWorkViewer.tsx +++ b/src/components/collection-explorer/work-viewer/ImageWorkViewer.tsx @@ -61,6 +61,7 @@ export const ImageWorkViewer: FC = ({ work }) => { }, [work]); const asset = work.imageAssets[pageNumber]; + if (!asset) return null; return (
= memo(({ work {!!work.imageAssets?.length && (
- + {work.imageAssets[0] && ( + + )}

x{work.imageAssets.length} diff --git a/src/components/header/CollectionButton.tsx b/src/components/header/CollectionButton.tsx index c66405a..58ae3a3 100644 --- a/src/components/header/CollectionButton.tsx +++ b/src/components/header/CollectionButton.tsx @@ -10,7 +10,7 @@ export const CollectionButton: FC = () => { const recentSelectRef = useRef(null); useEffect(() => { - if (!recentPaths || recentPaths.length === 0 || collectionName !== null) return; + if (!recentPaths || recentPaths[0] === undefined || collectionName !== null) return; switchCollection(recentPaths[0]); }, [recentPaths, collectionName, switchCollection]); @@ -51,7 +51,7 @@ export const CollectionButton: FC = () => {