feat(settings): handle no models

This commit is contained in:
ItzCrazyKns 2024-10-18 17:07:09 +05:30
parent 36bb265e1f
commit 8057f28b20
1 changed files with 3 additions and 1 deletions

View File

@ -128,7 +128,9 @@ const SettingsDialog = ({
const chatModel = const chatModel =
localStorage.getItem('chatModel') || localStorage.getItem('chatModel') ||
(data.chatModelProviders && (data.chatModelProviders &&
data.chatModelProviders[chatModelProvider]?.[0].name) || data.chatModelProviders[chatModelProvider]?.length > 0
? data.chatModelProviders[chatModelProvider][0].name
: undefined) ||
''; '';
const embeddingModelProvider = const embeddingModelProvider =
localStorage.getItem('embeddingModelProvider') || localStorage.getItem('embeddingModelProvider') ||