1
0
mirror of https://github.com/coalaura/whiskr.git synced 2025-09-09 01:09:54 +00:00

improve sorting

This commit is contained in:
Laura
2025-08-09 22:20:18 +02:00
parent 91d9ce4449
commit b258085d5e
2 changed files with 5 additions and 2 deletions

View File

@@ -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 {

View File

@@ -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) {