Add guest Live Show opt-in toggle
This commit is contained in:
@@ -67,6 +67,9 @@ export interface EventData {
|
||||
};
|
||||
branding?: EventBrandingPayload | null;
|
||||
guest_upload_visibility?: 'immediate' | 'review';
|
||||
live_show?: {
|
||||
moderation_mode?: 'off' | 'manual' | 'trusted_only';
|
||||
};
|
||||
}
|
||||
|
||||
export interface PackageData {
|
||||
@@ -262,6 +265,7 @@ export async function fetchEvent(eventKey: string): Promise<EventData> {
|
||||
|
||||
const json = await res.json();
|
||||
|
||||
const moderationMode = json?.live_show?.moderation_mode;
|
||||
const normalized: EventData = {
|
||||
...json,
|
||||
name: coerceLocalized(json?.name, 'Fotospiel Event'),
|
||||
@@ -271,6 +275,11 @@ export async function fetchEvent(eventKey: string): Promise<EventData> {
|
||||
engagement_mode: (json?.engagement_mode as 'tasks' | 'photo_only' | undefined) ?? 'tasks',
|
||||
guest_upload_visibility:
|
||||
json?.guest_upload_visibility === 'immediate' ? 'immediate' : 'review',
|
||||
live_show: {
|
||||
moderation_mode: moderationMode === 'off' || moderationMode === 'manual' || moderationMode === 'trusted_only'
|
||||
? moderationMode
|
||||
: 'manual',
|
||||
},
|
||||
demo_read_only: Boolean(json?.demo_read_only),
|
||||
};
|
||||
|
||||
|
||||
@@ -100,6 +100,7 @@ type UploadOptions = {
|
||||
signal?: AbortSignal;
|
||||
maxRetries?: number;
|
||||
onRetry?: (attempt: number) => void;
|
||||
liveShowOptIn?: boolean;
|
||||
};
|
||||
|
||||
export async function uploadPhoto(
|
||||
@@ -114,6 +115,9 @@ export async function uploadPhoto(
|
||||
if (taskId) formData.append('task_id', taskId.toString());
|
||||
if (emotionSlug) formData.append('emotion_slug', emotionSlug);
|
||||
if (options.guestName) formData.append('guest_name', options.guestName);
|
||||
if (typeof options.liveShowOptIn === 'boolean') {
|
||||
formData.append('live_show_opt_in', options.liveShowOptIn ? '1' : '0');
|
||||
}
|
||||
formData.append('device_id', getDeviceId());
|
||||
|
||||
const maxRetries = options.maxRetries ?? 2;
|
||||
|
||||
Reference in New Issue
Block a user