Show photobooth filter only when enabled
This commit is contained in:
@@ -12,6 +12,7 @@ import { fetchEvent, type EventData } from '../services/eventApi';
|
||||
import { useTranslation } from '../i18n/useTranslation';
|
||||
import { useToast } from '../components/ToastHost';
|
||||
import { localizeTaskLabel } from '../lib/localizeTaskLabel';
|
||||
import { shouldShowPhotoboothFilter } from '../lib/galleryFilters';
|
||||
import { createPhotoShareLink } from '../services/photosApi';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { useEventBranding } from '../context/EventBrandingContext';
|
||||
@@ -96,10 +97,7 @@ export default function GalleryPage() {
|
||||
});
|
||||
|
||||
const typedPhotos = photos as GalleryPhoto[];
|
||||
const showPhotoboothFilter = React.useMemo(
|
||||
() => Boolean(event?.photobooth_enabled) || typedPhotos.some((p) => p.ingest_source === 'photobooth'),
|
||||
[event?.photobooth_enabled, typedPhotos],
|
||||
);
|
||||
const showPhotoboothFilter = React.useMemo(() => shouldShowPhotoboothFilter(event), [event]);
|
||||
const allowedGalleryFilters = React.useMemo<GalleryFilter[]>(
|
||||
() => (showPhotoboothFilter ? allGalleryFilters : ['latest', 'popular', 'mine']),
|
||||
[showPhotoboothFilter],
|
||||
|
||||
Reference in New Issue
Block a user