From 670b65c06692bf8bc9b65756d228e6f2de0eee0b Mon Sep 17 00:00:00 2001 From: Ased Mammad Date: Sun, 3 Mar 2024 13:34:26 +0330 Subject: [PATCH] fix: add missed imports --- src/routes/(app)/+page.svelte | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte index d4f415b3a..ed4600b2c 100644 --- a/src/routes/(app)/+page.svelte +++ b/src/routes/(app)/+page.svelte @@ -2,7 +2,7 @@ import { v4 as uuidv4 } from 'uuid'; import { toast } from 'svelte-sonner'; - import { onMount, tick } from 'svelte'; + import { onMount, tick, getContext } from 'svelte'; import { goto } from '$app/navigation'; import { page } from '$app/stores'; @@ -39,6 +39,9 @@ import { RAGTemplate } from '$lib/utils/rag'; import { LITELLM_API_BASE_URL, OPENAI_API_BASE_URL } from '$lib/constants'; import { WEBUI_BASE_URL } from '$lib/constants'; + + const i18n = getContext('i18n'); + let stopResponseFlag = false; let autoScroll = true; let processing = ''; @@ -166,7 +169,9 @@ ) { // Upload not done toast.error( - $i18n.t(`Oops! Hold tight! Your files are still in the processing oven. We're cooking them up to perfection. Please be patient and we'll let you know once they're ready.`) + $i18n.t( + `Oops! Hold tight! Your files are still in the processing oven. We're cooking them up to perfection. Please be patient and we'll let you know once they're ready.` + ) ); } else { // Reset chat message textarea height @@ -511,12 +516,18 @@ responseMessage.content = error.error; } } else { - toast.error($i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, {provider: 'Ollama'})); - responseMessage.content = $i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, {provider: 'Ollama'}); + toast.error( + $i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, { provider: 'Ollama' }) + ); + responseMessage.content = $i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, { + provider: 'Ollama' + }); } responseMessage.error = true; - responseMessage.content = $i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, {provider: 'Ollama'}); + responseMessage.content = $i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, { + provider: 'Ollama' + }); responseMessage.done = true; messages = messages; } @@ -678,12 +689,18 @@ } } } else { - toast.error($i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, {provider: model})); - responseMessage.content = $i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, {provider: model}}); + toast.error( + $i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, { provider: model }) + ); + responseMessage.content = $i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, { + provider: model + }); } responseMessage.error = true; - responseMessage.content = $i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, {provider: model}); + responseMessage.content = $i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, { + provider: model + }); responseMessage.done = true; messages = messages; }