fix(ui): correct admin mode detection logic
This commit is contained in:
@@ -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('');
|
||||||
|
|||||||
Reference in New Issue
Block a user