From 1c48a712f11c1f04a3e6ab023dab4e163e172f23 Mon Sep 17 00:00:00 2001 From: Chukwuma Nwaugha Date: Mon, 11 Nov 2024 16:38:26 +0000 Subject: [PATCH] cleanup --- .../lib/components/CheckFinalResponse.svelte | 21 ++++++++++++------- .../lib/components/RenderAudioSource.svelte | 18 +++++++--------- .../chat/[sessionId=sessionId]/+page.svelte | 7 ++----- 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/app/src/lib/components/CheckFinalResponse.svelte b/app/src/lib/components/CheckFinalResponse.svelte index d565f48..2290bf2 100644 --- a/app/src/lib/components/CheckFinalResponse.svelte +++ b/app/src/lib/components/CheckFinalResponse.svelte @@ -8,6 +8,7 @@ import { createEventDispatcher } from 'svelte'; import { Button } from './ui/button'; import { getSessionContext } from '@/stores/sessionContext.svelte'; + import RenderAudioSource from '@/components/RenderAudioSource.svelte'; export let content: string; @@ -17,7 +18,7 @@ generate: { summary: string }; }>(); - const { sessionId$, sessionCompleted$ } = getSessionContext(); + const { sessionId$, sessionCompleted$, audioSource$ } = getSessionContext(); function getSummary() { const replacePrefixRegex = new RegExp(FINAL_RESPONSE_PREFIX, 'gi'); @@ -42,13 +43,17 @@ on:click={() => dispatch('generate', { summary: getSummary() })}>Generate Audiocast - + {#if $audioSource$} + + {:else} + + {/if} @@ -23,13 +22,10 @@ Audiocast Source -
snapPoints[0] - })} - > + >Audiocast Source + + +
diff --git a/app/src/routes/chat/[sessionId=sessionId]/+page.svelte b/app/src/routes/chat/[sessionId=sessionId]/+page.svelte index 1066d92..0a24d9d 100644 --- a/app/src/routes/chat/[sessionId=sessionId]/+page.svelte +++ b/app/src/routes/chat/[sessionId=sessionId]/+page.svelte @@ -12,11 +12,10 @@ import { onMount } from 'svelte'; import { debounce } from 'throttle-debounce'; import Spinner from '@/components/Spinner.svelte'; - import RenderAudioSource from '@/components/RenderAudioSource.svelte'; export let data; - const { session$, addChatItem, updateChatContent, sessionId$, fetchingSource$, audioSource$ } = + const { session$, addChatItem, updateChatContent, sessionId$, fetchingSource$ } = getSessionContext(); let searchTerm = ''; @@ -102,9 +101,7 @@ {@const finalResponse = item.content.includes(FINAL_RESPONSE_SUFFIX)} - {#if finalResponse && $audioSource$} - - {:else if finalResponse} + {#if finalResponse} {#if $fetchingSource$}