Merge branch '716-upload-reorder' into 'master'

Fix #716: constant and unpredictable reordering during file upload

See merge request funkwhale/funkwhale!647
This commit is contained in:
Eliot Berriot 2019-03-07 10:38:17 +01:00
commit 9dcfc20571
2 changed files with 9 additions and 5 deletions

View File

@ -0,0 +1 @@
Fixed constant and unpredictable reordering during file upload (#716)

View File

@ -279,15 +279,18 @@ export default {
}, },
sortedFiles() { sortedFiles() {
// return errored files on top // return errored files on top
return this.files.sort(f => {
return _.sortBy(this.files.map(f => {
let statusIndex = 0
if (f.errored) { if (f.errored) {
return -5; statusIndex = -1
} }
if (f.success) { if (f.success) {
return 5; statusIndex = 1
} }
return 0; f.statusIndex = statusIndex
}); return f
}), ['statusIndex', 'name'])
} }
}, },
watch: { watch: {