From 3b4ee0f1277fe18f694b62182ca905311d370dd3 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 11 Nov 2024 00:44:46 -0800 Subject: [PATCH] refac --- .../chat/MessageInput/InputMenu.svelte | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/src/lib/components/chat/MessageInput/InputMenu.svelte b/src/lib/components/chat/MessageInput/InputMenu.svelte index 9cb1b6198..6ae35a259 100644 --- a/src/lib/components/chat/MessageInput/InputMenu.svelte +++ b/src/lib/components/chat/MessageInput/InputMenu.svelte @@ -58,30 +58,30 @@ {#if Object.keys(tools).length > 0}
{#each Object.keys(tools) as toolId} -
{ + selectedToolIds = tools[toolId].enabled + ? selectedToolIds.filter((id) => id !== toolId) + : [...selectedToolIds, toolId]; + }} > -
+
-
{tools[toolId].name}
+
{tools[toolId].name}
- { - selectedToolIds = e.detail - ? [...selectedToolIds, toolId] - : selectedToolIds.filter((id) => id !== toolId); - }} - /> -
+
+ +
+ {/each}
@@ -89,16 +89,19 @@ {/if} {#if $config?.features?.enable_web_search} -
{ + webSearchEnabled = !webSearchEnabled; + }} >
{$i18n.t('Web Search')}
- -
+ +
{/if}