From 7f93311150ddfbd8ca319a95368cdbebbfa33fbc Mon Sep 17 00:00:00 2001 From: wvffle Date: Tue, 27 Dec 2022 22:57:51 +0000 Subject: [PATCH] feat(ui): update upload status with error message if import failed Part-of: --- changes/changelog.d/1999.enhancement | 1 + front/src/components/library/FileUpload.vue | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 changes/changelog.d/1999.enhancement diff --git a/changes/changelog.d/1999.enhancement b/changes/changelog.d/1999.enhancement new file mode 100644 index 000000000..807a19be2 --- /dev/null +++ b/changes/changelog.d/1999.enhancement @@ -0,0 +1 @@ +Update upload status when import fails (#1999) diff --git a/front/src/components/library/FileUpload.vue b/front/src/components/library/FileUpload.vue index 29b57e77b..863cad349 100644 --- a/front/src/components/library/FileUpload.vue +++ b/front/src/components/library/FileUpload.vue @@ -128,6 +128,15 @@ useWebSocketHandler('import.status_updated', async (event) => { // TODO (wvffle): Why? await nextTick() + if (event.new_status === 'errored') { + for (const file of files.value) { + if (file.response?.uuid === event.upload.uuid) { + file.error = event.new_status + break + } + } + } + uploads[event.old_status] -= 1 uploads[event.new_status] += 1 uploads.objects[event.upload.uuid] = event.upload