From 3c8944cb1243c91ce1cefae16bdb6cdc597b783f Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 22 Oct 2024 03:22:45 -0700 Subject: [PATCH] refac --- src/lib/components/chat/Chat.svelte | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 608ef05f9..20f5f81cd 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -473,12 +473,12 @@ } else if ($config?.default_models) { console.log($config?.default_models.split(',') ?? ''); selectedModels = $config?.default_models.split(','); + } + + if ($models.length > 0) { + selectedModels = [$models[0].id]; } else { - if ($models.length > 0) { - selectedModels = [$models[0].id]; - } else { - selectedModels = ['']; - } + selectedModels = ['']; } if ($page.url.searchParams.get('youtube')) { @@ -486,7 +486,6 @@ `https://www.youtube.com/watch?v=${$page.url.searchParams.get('youtube')}` ); } - if ($page.url.searchParams.get('web-search') === 'true') { webSearchEnabled = true; }