Add order to tasks and lists

This commit is contained in:
Bel LaPointe
2019-11-25 12:57:47 -07:00
parent f2e3a71348
commit 48e8b91039
6 changed files with 29 additions and 2 deletions

View File

@@ -77,7 +77,10 @@ func (a *Ajax) storageListTasks(listID string, filters ...func(t *task.Task) boo
}
}
sort.SliceStable(tasks, func(i, j int) bool {
return tasks[i].Created.Before(tasks[j].Created)
if tasks[i].Index == tasks[j].Index {
return tasks[i].Created.Before(tasks[j].Created)
}
return tasks[i].Index < tasks[j].Index
})
return tasks, nil
}