updated table structure for photobooth/sparkbooth settings. now there's a separate table for it. update all references and tests. also fixed the notification panel and the lightbox in the guest app.
This commit is contained in:
@@ -1,7 +1,14 @@
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import type { LocaleCode } from '../i18n/messages';
|
||||
|
||||
type Photo = { id: number; file_path?: string; thumbnail_path?: string; created_at?: string; session_id?: string | null };
|
||||
type Photo = {
|
||||
id: number;
|
||||
file_path?: string;
|
||||
thumbnail_path?: string;
|
||||
created_at?: string;
|
||||
session_id?: string | null;
|
||||
uploader_name?: string | null;
|
||||
};
|
||||
type RawPhoto = Record<string, unknown>;
|
||||
|
||||
export function usePollGalleryDelta(token: string, locale: LocaleCode) {
|
||||
@@ -60,6 +67,12 @@ export function usePollGalleryDelta(token: string, locale: LocaleCode) {
|
||||
const newPhotos: Photo[] = rawPhotos.map((photo: RawPhoto) => ({
|
||||
...(photo as Photo),
|
||||
session_id: typeof photo.session_id === 'string' ? photo.session_id : (photo.guest_name as string | null) ?? null,
|
||||
uploader_name:
|
||||
typeof photo.uploader_name === 'string'
|
||||
? (photo.uploader_name as string)
|
||||
: typeof photo.guest_name === 'string'
|
||||
? (photo.guest_name as string)
|
||||
: null,
|
||||
}));
|
||||
|
||||
if (newPhotos.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user