diff --git a/src/modules/resource/pages/ResourcePage.vue b/src/modules/resource/pages/ResourcePage.vue index b6414db53239997d87ac7eea8c30390703c03591..7eafa33b867f98515f60a251455ee114a1e606bc 100644 --- a/src/modules/resource/pages/ResourcePage.vue +++ b/src/modules/resource/pages/ResourcePage.vue @@ -421,13 +421,26 @@ export default defineComponent({ lastModified: `${file.lastModified}`, metadata: { [version]: factory.dataset() as unknown as Dataset }, }; - this.fileListUpload.push(fileInformation); + + // Prevent duplicates + if ( + !this.fileListUpload.some( + (entry) => entry.path === fileInformation.path, + ) + ) { + this.fileListUpload.push(fileInformation); + } } // Clear selection in files view table ( (this.$refs.filesView as Vue).$refs.adaptTable as BTable ).clearSelected(); + + // Clear form-file inputs + (this.$refs.fileTrigger as BFormFile).reset(); + (this.$refs.folderTrigger as BFormFile).reset(); + this.showDetail = false; },