diff --git a/src/components/assets/missing-location/MissingLocationAssets.tsx b/src/components/assets/missing-location/MissingLocationAssets.tsx index a60b2b4..b06c436 100644 --- a/src/components/assets/missing-location/MissingLocationAssets.tsx +++ b/src/components/assets/missing-location/MissingLocationAssets.tsx @@ -51,19 +51,7 @@ export default function MissingLocationAssets({ groupBy }: IProps) { sortedAssets = [...assets]; } - return sortedAssets.map((asset) => ({ - ...asset, - tags: [ - { - title: "Immich Link", - value: ( - - Open in Immich - - ), - }, - ], - })); + return sortedAssets; }, [assets, sortOrder, exImmichUrl]); const handleSelectionChange = (ids: string[]) => { diff --git a/src/components/shared/AssetGrid.tsx b/src/components/shared/AssetGrid.tsx index fbcd366..473e5be 100644 --- a/src/components/shared/AssetGrid.tsx +++ b/src/components/shared/AssetGrid.tsx @@ -8,6 +8,7 @@ import LazyGridImage from "../ui/lazy-grid-image"; import Download from "yet-another-react-lightbox/plugins/download"; import Video from "yet-another-react-lightbox/plugins/video"; import { usePhotoSelectionContext } from '@/contexts/PhotoSelectionContext'; +import { useConfig } from '@/contexts/ConfigContext'; interface AssetGridProps { @@ -26,7 +27,7 @@ interface AssetGridRef { const AssetGrid = forwardRef(({ assets, isInternal = true, selectable = false, onSelectionChange }, ref) => { const [index, setIndex] = useState(-1); const [lastSelectedIndex, setLastSelectedIndex] = useState(-1); - + const { exImmichUrl } = useConfig(); // Use context for selection state const { selectedIds, updateContext } = usePhotoSelectionContext(); @@ -112,8 +113,18 @@ const AssetGrid = forwardRef(({ assets, isInternal orientation: 1, isSelected: selectedIds.includes(p.id), isVideo: p.type === "VIDEO", + tags: [ + { + title: "Immich Link", + value: ( + + Open in Immich + + ), + }, + ], })); - }, [assets, selectedIds]); + }, [assets, selectedIds, exImmichUrl]); const handleEsc = (event: KeyboardEvent) => { if (event.key === "Escape") {