Handle no-tasks mode in guest v2
This commit is contained in:
@@ -3,6 +3,6 @@ import type { EventData } from '../services/eventApi';
|
||||
export function isTaskModeEnabled(event?: EventData | null): boolean {
|
||||
if (!event) return true;
|
||||
const mode = event.engagement_mode;
|
||||
if (mode === 'photo_only') return false;
|
||||
return true;
|
||||
if (!mode) return true;
|
||||
return mode === 'tasks';
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ export interface EventData {
|
||||
slug: string;
|
||||
name: string;
|
||||
default_locale: string;
|
||||
engagement_mode?: 'tasks' | 'photo_only';
|
||||
engagement_mode?: 'tasks' | 'photo_only' | 'no_tasks';
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
join_token?: string | null;
|
||||
@@ -283,7 +283,7 @@ export async function fetchEvent(eventKey: string): Promise<EventData> {
|
||||
default_locale: typeof json?.default_locale === 'string' && json.default_locale.trim() !== ''
|
||||
? json.default_locale
|
||||
: DEFAULT_LOCALE,
|
||||
engagement_mode: (json?.engagement_mode as 'tasks' | 'photo_only' | undefined) ?? 'tasks',
|
||||
engagement_mode: (json?.engagement_mode as 'tasks' | 'photo_only' | 'no_tasks' | undefined) ?? 'tasks',
|
||||
guest_upload_visibility:
|
||||
json?.guest_upload_visibility === 'immediate' ? 'immediate' : 'review',
|
||||
live_show: {
|
||||
|
||||
Reference in New Issue
Block a user