diff --git a/app/src/lib/components/AudiocastPageHeader.svelte b/app/src/lib/components/AudiocastPageHeader.svelte index 80a4348..95a6e95 100644 --- a/app/src/lib/components/AudiocastPageHeader.svelte +++ b/app/src/lib/components/AudiocastPageHeader.svelte @@ -1,16 +1,16 @@ -
+
- {session.category} + {category} - {#if session.metadata?.title} -

{session.metadata.title}

- {/if} +

{title}

diff --git a/app/src/lib/components/AudiocastPageSkeletonLoader.svelte b/app/src/lib/components/AudiocastPageSkeletonLoader.svelte index 797466f..d33ed2e 100644 --- a/app/src/lib/components/AudiocastPageSkeletonLoader.svelte +++ b/app/src/lib/components/AudiocastPageSkeletonLoader.svelte @@ -1,5 +1,4 @@ -
- +
diff --git a/app/src/routes/audiocast/[sessionId=sessionId]/+page.svelte b/app/src/routes/audiocast/[sessionId=sessionId]/+page.svelte index b9b5160..396eaeb 100644 --- a/app/src/routes/audiocast/[sessionId=sessionId]/+page.svelte +++ b/app/src/routes/audiocast/[sessionId=sessionId]/+page.svelte @@ -25,7 +25,7 @@ import AudiocastPageSkeletonLoader from '@/components/AudiocastPageSkeletonLoader.svelte'; import RenderAudioSources from '@/components/RenderAudioSources.svelte'; import AudiocastPageHeader from '@/components/AudiocastPageHeader.svelte'; - import { startWith, tap } from 'rxjs'; + import { startWith, tap, switchMap, of } from 'rxjs'; export let data; @@ -38,6 +38,7 @@ $: sessionModel = data.sessionModel; $: sessionModel$.pipe( + switchMap((v) => of(v)), tap((v) => v && (sessionModel = v)), startWith(data.sessionModel) ); @@ -63,7 +64,7 @@ return fetch(`${env.API_BASE_URL}/audiocast/${sessionId}`).then((res) => { if (res.ok) return res.json(); else if (res.status === 404 && $session$?.summary) { - return generateAudiocast(sessionId, $session$.category, $session$.summary); + return generateAudiocast(sessionId, sessionModel.category, $session$.summary); } throw new Error('Failed to get audiocast'); @@ -71,11 +72,13 @@ } -
- +
+ {#await getAudiocast(sessionId)} -
+
{#if generating} @@ -93,7 +96,7 @@ {/if}
{:then} -
+