From 8057f28b20a8fcb26f5c546d17bcf316384d219c Mon Sep 17 00:00:00 2001 From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com> Date: Fri, 18 Oct 2024 17:07:09 +0530 Subject: [PATCH] feat(settings): handle no models --- ui/components/SettingsDialog.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/components/SettingsDialog.tsx b/ui/components/SettingsDialog.tsx index 34ef26c1..716dd7d4 100644 --- a/ui/components/SettingsDialog.tsx +++ b/ui/components/SettingsDialog.tsx @@ -128,7 +128,9 @@ const SettingsDialog = ({ const chatModel = localStorage.getItem('chatModel') || (data.chatModelProviders && - data.chatModelProviders[chatModelProvider]?.[0].name) || + data.chatModelProviders[chatModelProvider]?.length > 0 + ? data.chatModelProviders[chatModelProvider][0].name + : undefined) || ''; const embeddingModelProvider = localStorage.getItem('embeddingModelProvider') ||