fix(ui): correct admin mode detection logic

This commit is contained in:
2026-09-06 16:07:48 +02:00
parent b7e88099c8
commit 1d74c6c111
+3 -1
View File
@@ -15,7 +15,9 @@
type AdminRsvp type AdminRsvp
} from '$lib/api'; } from '$lib/api';
const isAdmin = $derived(page.url.searchParams.get('admin') === '1'); // Guarded by `browser`: the site is prerendered and page.url.searchParams
// is inaccessible during prerender/SSR. Admin mode is a client-only concern.
const isAdmin = $derived(browser && page.url.searchParams.has('admin'));
let status = $state<'loading' | 'done' | 'error'>('loading'); let status = $state<'loading' | 'done' | 'error'>('loading');
let errorMessage = $state(''); let errorMessage = $state('');