fix: sort order by dueDate, then by id

This commit is contained in:
Dominik Pschenitschni 2021-10-17 16:30:34 +02:00
parent 2de94bc902
commit ae971b23bc
Signed by untrusted user: dpschen
GPG Key ID: B257AC0149F43A77
1 changed files with 6 additions and 1 deletions

View File

@ -207,7 +207,12 @@ export default {
// soonest before the later ones.
// We can't use the api sorting here because that sorts tasks with a due date after
// ones without a due date.
this.tasks = tasks.sort((a, b) => a.dueDate - b.dueDate)
this.tasks = tasks.sort((a, b) => {
const sortByDueDate = b.dueDate - a.dueDate
return sortByDueDate === 0
? b.id - a.id
: sortByDueDate
})
},
// FIXME: this modification should happen in the store