Sort Order for tasks #110
|
@ -199,7 +199,10 @@ func sortTasks(tasks []*Task, by []*sortParam) {
|
|||
// Always sort at least by id asc so we have a consistent order of items every time
|
||||
// If we would not do this, we would get a different order for items with the same content every time
|
||||
// the slice is sorted. To circumvent this, we always order at least by ID.
|
||||
by = append(by, &sortParam{sortBy: taskPropertyID, orderBy: orderAscending})
|
||||
if len(by) == 0 ||
|
||||
(len(by) > 0 && by[len(by)-1].sortBy != taskPropertyID) { // Don't sort by ID last if the id parameter is already passed as the last parameter.
|
||||
by = append(by, &sortParam{sortBy: taskPropertyID, orderBy: orderAscending})
|
||||
}
|
||||
|
||||
comparators := make([]taskComparator, 0, len(by))
|
||||
for _, param := range by {
|
||||
|
|
Loading…
Reference in New Issue