diff --git a/package-lock.json b/package-lock.json index 201f414d..a83dd2c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "utopia-ui", - "version": "3.0.81", + "version": "3.0.85", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "utopia-ui", - "version": "3.0.81", + "version": "3.0.85", "license": "GPL-3.0-only", "dependencies": { "@heroicons/react": "^2.0.17", diff --git a/package.json b/package.json index 6b8101f3..076bc3bf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "utopia-ui", - "version": "3.0.81", + "version": "3.0.85", "description": "Reuseable React Components to build mapping apps for real life communities and networks", "repository": "https://github.com/utopia-os/utopia-ui", "homepage": "https://utopia-os.org/", diff --git a/src/Components/Profile/Subcomponents/GalleryView.tsx b/src/Components/Profile/Subcomponents/GalleryView.tsx index be2e7830..d167aec0 100644 --- a/src/Components/Profile/Subcomponents/GalleryView.tsx +++ b/src/Components/Profile/Subcomponents/GalleryView.tsx @@ -9,26 +9,25 @@ 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) => { - return { + const images = + item.gallery?.map((i, j) => ({ src: appState.assetsApi.url + `${i.directus_files_id.id}.jpg`, width: i.directus_files_id.width, height: i.directus_files_id.height, index: j, - } - }) + })) ?? [] - if (!images) throw new Error('GalleryView: images is undefined') + if (images.length > 0) + return ( +