From dc14616bc44b7977a41e25c07153d2b5956783f1 Mon Sep 17 00:00:00 2001 From: Jannik Stehle Date: Tue, 3 May 2022 12:53:01 +0200 Subject: [PATCH] Slight adjustments after rebasing --- .../src/components/AppBar/CreateAndUpload.vue | 5 ++++- packages/web-app-files/src/views/FilesDrop.vue | 7 ++++++- packages/web-runtime/src/components/UploadInfo.vue | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/web-app-files/src/components/AppBar/CreateAndUpload.vue b/packages/web-app-files/src/components/AppBar/CreateAndUpload.vue index 21036f9a3cd..81296331da3 100644 --- a/packages/web-app-files/src/components/AppBar/CreateAndUpload.vue +++ b/packages/web-app-files/src/components/AppBar/CreateAndUpload.vue @@ -281,7 +281,10 @@ export default defineComponent({ resource = buildResource(resource) - this.$uppyService.$emit('uploadedFileFetched', file, resource) + this.$uppyService.publish('uploadedFileFetched', { + uppyResource: file, + fetchedFile: resource + }) // Update table only if the file was uploaded to the current directory if (fileIsInCurrentPath) { diff --git a/packages/web-app-files/src/views/FilesDrop.vue b/packages/web-app-files/src/views/FilesDrop.vue index 774a0250d7c..73e398f5908 100644 --- a/packages/web-app-files/src/views/FilesDrop.vue +++ b/packages/web-app-files/src/views/FilesDrop.vue @@ -165,7 +165,12 @@ export default { }, onFileSuccess(uppyResource) { - this.$uppyService.$emit('uploadedFileFetched', uppyResource, { name: uppyResource.name }) + this.$uppyService.publish('uploadedFileFetched', { + uppyResource, + fetchedFile: { + name: uppyResource.name + } + }) }, onFileError(error) { diff --git a/packages/web-runtime/src/components/UploadInfo.vue b/packages/web-runtime/src/components/UploadInfo.vue index d5e7830d071..670da1654d3 100644 --- a/packages/web-runtime/src/components/UploadInfo.vue +++ b/packages/web-runtime/src/components/UploadInfo.vue @@ -120,7 +120,7 @@ export default { this.closeInfo() } }) - this.$uppyService.subscribe('uploadedFileFetched', (uppyResource, fetchedFile) => { + this.$uppyService.subscribe('uploadedFileFetched', ({ uppyResource, fetchedFile }) => { this.successfulUploads.push({ ...fetchedFile, targetRoute: uppyResource.meta.route @@ -161,7 +161,7 @@ export default { query: targetRoute.query, params: { ...(storageId && path && { storageId }), - storage: targetRoute.params?.storage + ...(targetRoute.params?.storage && { storage: targetRoute.params?.storage }) } }