From a7d8ed0c6dc6b66ee9d37dc3a7d9812da71a7d7f Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Fri, 21 Feb 2025 12:11:21 -0800 Subject: [PATCH] refac --- src/lib/components/chat/Chat.svelte | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 98be06f5c..7de69f693 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -1493,7 +1493,10 @@ params?.system ?? $settings?.system ?? '', $user.name, $settings?.userLocation - ? await getAndUpdateUserLocation(localStorage.token) + ? await getAndUpdateUserLocation(localStorage.token).catch((err) => { + console.error(err); + return undefined; + }) : undefined )}${ (responseMessage?.userContext ?? null) @@ -1578,7 +1581,12 @@ variables: { ...getPromptVariables( $user.name, - $settings?.userLocation ? await getAndUpdateUserLocation(localStorage.token) : undefined + $settings?.userLocation + ? await getAndUpdateUserLocation(localStorage.token).catch((err) => { + console.error(err); + return undefined; + }) + : undefined ) }, model_item: $models.find((m) => m.id === model.id),