diff --git a/frontend/src/features/document/ui/DocumentUpload.vue b/frontend/src/features/document/ui/DocumentUpload.vue index f1e900b..f5e3c0b 100644 --- a/frontend/src/features/document/ui/DocumentUpload.vue +++ b/frontend/src/features/document/ui/DocumentUpload.vue @@ -18,6 +18,7 @@ {{ t('upload.drop') }} {{ t('upload.maxSize') }} + {{ store.error }} @@ -42,8 +43,13 @@ async function onFileSelect(e: Event) { const target = e.target as HTMLInputElement const file = target.files?.[0] if (file) { - const doc = await store.upload(file) - if (doc) emit('uploaded', doc.id) + try { + store.clearError() + const doc = await store.upload(file) + if (doc) emit('uploaded', doc.id) + } catch { + // error is already set in store.upload + } } target.value = '' } @@ -52,8 +58,13 @@ async function onDrop(e: DragEvent) { dragging.value = false const file = e.dataTransfer?.files?.[0] if (file && file.type === 'application/pdf') { - const doc = await store.upload(file) - if (doc) emit('uploaded', doc.id) + try { + store.clearError() + const doc = await store.upload(file) + if (doc) emit('uploaded', doc.id) + } catch { + // error is already set in store.upload + } } } @@ -103,6 +114,12 @@ async function onDrop(e: DragEvent) { color: var(--text-muted); } +.upload-error { + font-size: 13px; + color: var(--error, #e53e3e); + font-weight: 500; +} + .spinner { width: 24px; height: 24px;