From 94a0bf90ce129271eba01723290875c33632a486 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 12 Nov 2024 22:50:11 -0800 Subject: [PATCH] refac --- src/lib/components/chat/MessageInput/InputMenu.svelte | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/lib/components/chat/MessageInput/InputMenu.svelte b/src/lib/components/chat/MessageInput/InputMenu.svelte index b1df43e25..b540dc6c5 100644 --- a/src/lib/components/chat/MessageInput/InputMenu.svelte +++ b/src/lib/components/chat/MessageInput/InputMenu.svelte @@ -31,7 +31,12 @@ init(); } + $: if (tools) { + selectedToolIds = Object.keys(tools).filter((toolId) => tools[toolId]?.enabled ?? false); + } + const init = async () => { + console.log('init'); if ($_tools === null) { await _tools.set(await getTools(localStorage.token)); } @@ -76,9 +81,7 @@