From 82a61e72e186185e68da2338fa1e01c6d708eca8 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Thu, 2 May 2024 01:15:58 -0700 Subject: [PATCH] refac: hide model set as default button --- src/lib/components/chat/ModelSelector.svelte | 10 +++++++--- src/lib/components/layout/Navbar.svelte | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/lib/components/chat/ModelSelector.svelte b/src/lib/components/chat/ModelSelector.svelte index b1a56db26..8f03975ba 100644 --- a/src/lib/components/chat/ModelSelector.svelte +++ b/src/lib/components/chat/ModelSelector.svelte @@ -13,6 +13,8 @@ export let selectedModels = ['']; export let disabled = false; + export let showSetDefault = true; + const saveDefaultModel = async () => { const hasEmptyModel = selectedModels.filter((it) => it === ''); if (hasEmptyModel.length) { @@ -106,6 +108,8 @@ {/each} -
- -
+{#if showSetDefault} +
+ +
+{/if} diff --git a/src/lib/components/layout/Navbar.svelte b/src/lib/components/layout/Navbar.svelte index 9e6189af8..8b193d45f 100644 --- a/src/lib/components/layout/Navbar.svelte +++ b/src/lib/components/layout/Navbar.svelte @@ -9,6 +9,7 @@ import ModelSelector from '../chat/ModelSelector.svelte'; import Tooltip from '../common/Tooltip.svelte'; import Menu from './Navbar/Menu.svelte'; + import { page } from '$app/stores'; const i18n = getContext('i18n'); @@ -31,7 +32,7 @@
{#if showModelSelector} - + {/if}