This commit is contained in:
Timothy Jaeryang Baek 2025-05-17 02:26:28 +04:00
parent 08e4c163ea
commit d54e588ec3

View File

@ -614,12 +614,16 @@
dismissible={true} dismissible={true}
edit={true} edit={true}
on:dismiss={async () => { on:dismiss={async () => {
try {
if (file.type !== 'collection' && !file?.collection) { if (file.type !== 'collection' && !file?.collection) {
if (file.id) { if (file.id) {
// This will handle both file deletion and Chroma cleanup // This will handle both file deletion and Chroma cleanup
await deleteFileById(localStorage.token, file.id); await deleteFileById(localStorage.token, file.id);
} }
} }
} catch (error) {
console.error('Error deleting file:', error);
}
// Remove from UI state // Remove from UI state
files.splice(fileIdx, 1); files.splice(fileIdx, 1);