diff --git a/changes/changelog.d/716.bugfix b/changes/changelog.d/716.bugfix new file mode 100644 index 000000000..1b9b182c9 --- /dev/null +++ b/changes/changelog.d/716.bugfix @@ -0,0 +1 @@ +Fixed constant and unpredictable reordering during file upload (#716) diff --git a/front/src/components/library/FileUpload.vue b/front/src/components/library/FileUpload.vue index b7c164eb1..06fbdbad6 100644 --- a/front/src/components/library/FileUpload.vue +++ b/front/src/components/library/FileUpload.vue @@ -279,15 +279,18 @@ export default { }, sortedFiles() { // return errored files on top - return this.files.sort(f => { + + return _.sortBy(this.files.map(f => { + let statusIndex = 0 if (f.errored) { - return -5; + statusIndex = -1 } if (f.success) { - return 5; + statusIndex = 1 } - return 0; - }); + f.statusIndex = statusIndex + return f + }), ['statusIndex', 'name']) } }, watch: {