Fix completing tasks, showing completed tasks, and stable display order. Sorting broken.
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"local/todo-server/server/ajax/task"
|
||||
"net/http"
|
||||
"path"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -75,6 +76,9 @@ func (a *Ajax) storageListTasks(listID string, filters ...func(t *task.Task) boo
|
||||
tasks = append(tasks, task)
|
||||
}
|
||||
}
|
||||
sort.SliceStable(tasks, func(i, j int) bool {
|
||||
return tasks[i].Created.Before(tasks[j].Created)
|
||||
})
|
||||
return tasks, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user