From 7e5bda6016538de7959b56b04293168396ca83e4 Mon Sep 17 00:00:00 2001 From: Jun Siang Cheah Date: Sat, 20 Apr 2024 21:19:36 +0100 Subject: [PATCH] fix: use model name when outputting error message --- src/routes/(app)/+page.svelte | 8 +++++--- src/routes/(app)/c/[id]/+page.svelte | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte index bdeff6d7a..b4a375be7 100644 --- a/src/routes/(app)/+page.svelte +++ b/src/routes/(app)/+page.svelte @@ -681,16 +681,18 @@ } } else { toast.error( - $i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, { provider: model }) + $i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, { + provider: model.name ?? model.id + }) ); responseMessage.content = $i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, { - provider: model + provider: model.name ?? model.id }); } responseMessage.error = true; responseMessage.content = $i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, { - provider: model + provider: model.name ?? model.id }); responseMessage.done = true; messages = messages; diff --git a/src/routes/(app)/c/[id]/+page.svelte b/src/routes/(app)/c/[id]/+page.svelte index 7502f3c4e..7b3ffd7a2 100644 --- a/src/routes/(app)/c/[id]/+page.svelte +++ b/src/routes/(app)/c/[id]/+page.svelte @@ -693,16 +693,18 @@ } } else { toast.error( - $i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, { provider: model }) + $i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, { + provider: model.name ?? model.id + }) ); responseMessage.content = $i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, { - provider: model + provider: model.name ?? model.id }); } responseMessage.error = true; responseMessage.content = $i18n.t(`Uh-oh! There was an issue connecting to {{provider}}.`, { - provider: model + provider: model.name ?? model.id }); responseMessage.done = true; messages = messages;