diff --git a/changes/changelog.d/716.bugfix b/changes/changelog.d/716.bugfix new file mode 100644 index 0000000000000000000000000000000000000000..1b9b182c93b8dc7984088624fa7ebbc8d1b6c49d --- /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 b7c164eb15d2918a76f19c7a6491da556ce2c58e..06fbdbad6a5e2b4428fc30981a00a9551b62b738 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: {