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}
-
+