From d54e588ec3d5d47f2d01d0fd6afb29d76931031b Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sat, 17 May 2025 02:26:28 +0400 Subject: [PATCH] refac --- src/lib/components/chat/MessageInput.svelte | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 1e7d30410..833b8df0d 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -614,11 +614,15 @@ dismissible={true} edit={true} on:dismiss={async () => { - if (file.type !== 'collection' && !file?.collection) { - if (file.id) { - // This will handle both file deletion and Chroma cleanup - await deleteFileById(localStorage.token, file.id); + try { + if (file.type !== 'collection' && !file?.collection) { + if (file.id) { + // This will handle both file deletion and Chroma cleanup + await deleteFileById(localStorage.token, file.id); + } } + } catch (error) { + console.error('Error deleting file:', error); } // Remove from UI state