diff --git a/ui/src/routes/api/auth/me/+server.ts b/ui/src/routes/api/auth/me/+server.ts index 0535d7a..0f2f2e9 100644 --- a/ui/src/routes/api/auth/me/+server.ts +++ b/ui/src/routes/api/auth/me/+server.ts @@ -13,7 +13,6 @@ export const GET: RequestHandler = async ({ locals }) => { return json({ id: locals.user.id, username: locals.user.username, - role: locals.user.role, - created: locals.user.created ?? '' + role: locals.user.role }); }; diff --git a/ui/src/routes/books/[slug]/chapters/[n]/+page.svelte b/ui/src/routes/books/[slug]/chapters/[n]/+page.svelte index b36215c..e305ba8 100644 --- a/ui/src/routes/books/[slug]/chapters/[n]/+page.svelte +++ b/ui/src/routes/books/[slug]/chapters/[n]/+page.svelte @@ -6,6 +6,10 @@ let { data }: { data: PageData } = $props(); + let html = $state(data.html); + let fetchingContent = $state(!data.isPreview && !data.html); + let fetchError = $state(''); + // ── Word count ──────────────────────────────────────────────────────────── function countWords(htmlStr: string | null): number { if (!htmlStr) return 0; @@ -15,10 +19,6 @@ const wordCount = $derived(countWords(html)); - let html = $state(data.html); - let fetchingContent = $state(!data.isPreview && !data.html); - let fetchError = $state(''); - onMount(async () => { // Record reading progress (skip for preview chapters) if (!data.isPreview) {