diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index fd28d417a..6db935113 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -654,7 +654,7 @@ ); } else if ( files.length > 0 && - files.filter((file) => file.type !== 'image' && file.status !== 'processed').length > 0 + files.filter((file) => file.type !== 'image' && file.status === 'uploading').length > 0 ) { // Upload not done toast.error( diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 4ab884318..08685f35b 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -93,7 +93,7 @@ url: '', name: file.name, collection_name: '', - status: '', + status: 'uploading', size: file.size, error: '' }; @@ -121,7 +121,7 @@ const uploadedFile = await uploadFile(localStorage.token, file); if (uploadedFile) { - fileItem.status = 'processed'; + fileItem.status = 'uploaded'; fileItem.file = uploadedFile; fileItem.id = uploadedFile.id; fileItem.collection_name = uploadedFile?.meta?.collection_name; @@ -433,7 +433,7 @@ name={file.name} type={file.type} size={file?.size} - status={file.status} + loading={file.status === 'uploading'} dismissible={true} edit={true} on:dismiss={() => { diff --git a/src/lib/components/common/FileItem.svelte b/src/lib/components/common/FileItem.svelte index a51e3c48b..733623c17 100644 --- a/src/lib/components/common/FileItem.svelte +++ b/src/lib/components/common/FileItem.svelte @@ -4,6 +4,7 @@ import FileItemModal from './FileItemModal.svelte'; import GarbageBin from '../icons/GarbageBin.svelte'; + import Spinner from './Spinner.svelte'; const i18n = getContext('i18n'); const dispatch = createEventDispatcher(); @@ -13,7 +14,7 @@ export let url: string | null = null; export let dismissible = false; - export let status = 'processed'; + export let loading = false; export let item = null; export let edit = false; @@ -49,7 +50,7 @@ }} >