mirror of
https://github.com/coalaura/whiskr.git
synced 2025-09-09 09:19:54 +00:00
improve sorting
This commit is contained in:
@@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -22,6 +23,10 @@ func LoadModels() ([]*Model, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sort.Slice(list, func(i, j int) bool {
|
||||||
|
return list[i].Created > list[j].Created
|
||||||
|
})
|
||||||
|
|
||||||
models := make([]*Model, len(list))
|
models := make([]*Model, len(list))
|
||||||
|
|
||||||
for index, model := range list {
|
for index, model := range list {
|
||||||
|
@@ -380,8 +380,6 @@
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
models.sort((a, b) => a.name > b.name);
|
|
||||||
|
|
||||||
$model.innerHTML = "";
|
$model.innerHTML = "";
|
||||||
|
|
||||||
for (const model of models) {
|
for (const model of models) {
|
||||||
|
Reference in New Issue
Block a user