diff --git a/app/src/lib/components/RenderExamples.svelte b/app/src/lib/components/RenderExamples.svelte index aac5283..a6e0489 100644 --- a/app/src/lib/components/RenderExamples.svelte +++ b/app/src/lib/components/RenderExamples.svelte @@ -1,13 +1,5 @@ - // $: userSpecification = $sessionStore.userSpecification; + @@ -21,9 +20,10 @@
- {#if $page.data.contentCategory} -

Content Category:

-

{$page.data.contentCategory}

+ {#if $page.data.category} +

+ Content Category: {$page.data.category} +

{:else}

Your preferences and audiocast metadata will appear here diff --git a/app/src/routes/[sessionId=sessionId]/+layout.server.ts b/app/src/routes/[sessionId=sessionId]/+layout.server.ts new file mode 100644 index 0000000..9fb43ea --- /dev/null +++ b/app/src/routes/[sessionId=sessionId]/+layout.server.ts @@ -0,0 +1,6 @@ +import type { LayoutServerLoad } from './$types'; +export const load: LayoutServerLoad = ({ url }) => { + return { + category: url.searchParams.get('category') + }; +}; diff --git a/app/src/routes/[sessionId=sessionId]/+page.ts b/app/src/routes/[sessionId=sessionId]/+page.ts index 8e5a07f..a593689 100644 --- a/app/src/routes/[sessionId=sessionId]/+page.ts +++ b/app/src/routes/[sessionId=sessionId]/+page.ts @@ -2,10 +2,8 @@ import { error, redirect } from '@sveltejs/kit'; import type { PageLoad } from './$types'; export const load: PageLoad = async ({ url, parent }) => { - const category = url.searchParams.get('category'); + const { sessionId, category } = await parent(); if (!category) error(400, 'Audio category was not found'); - - const { sessionId } = await parent(); if (url.pathname !== `/${sessionId}`) redirect(307, '/'); return {