diff --git a/src/Components/Profile/Subcomponents/GalleryView.tsx b/src/Components/Profile/Subcomponents/GalleryView.tsx index 7cf2bc37..affd8515 100644 --- a/src/Components/Profile/Subcomponents/GalleryView.tsx +++ b/src/Components/Profile/Subcomponents/GalleryView.tsx @@ -1,7 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unsafe-assignment */ -/* eslint-disable @typescript-eslint/restrict-template-expressions */ -/* eslint-disable @typescript-eslint/no-unsafe-call */ -/* eslint-disable @typescript-eslint/no-unsafe-member-access */ import { useState } from 'react' import { RowsPhotoAlbum } from 'react-photo-album' import ReactLightbox from 'yet-another-react-lightbox' @@ -15,7 +11,7 @@ import type { Item } from '#types/Item' export const GalleryView = ({ item }: { item: Item }) => { const [index, setIndex] = useState(-1) const appState = useAppState() - const images = item.gallery.map((i, j) => { + const images = item.gallery?.map((i, j) => { return { src: appState.assetsApi.url + `${i.directus_files_id.id}.jpg`, width: i.directus_files_id.width, @@ -23,6 +19,9 @@ export const GalleryView = ({ item }: { item: Item }) => { index: j, } }) + + if (!images) throw new Error('GalleryView: images is undefined') + return (