fix(tui): sort model picker by release date (#33558)
This commit is contained in:
parent
784eea3911
commit
c416ede20d
2 changed files with 12 additions and 6 deletions
|
|
@ -118,7 +118,10 @@ export function DialogModel(props: { providerID?: string }) {
|
|||
|
||||
if (needle) {
|
||||
return [
|
||||
...fuzzysort.go(needle, providerOptions, { keys: ["title", "category"] }).map((x) => x.obj),
|
||||
...sortModelOptions(
|
||||
fuzzysort.go(needle, providerOptions, { keys: ["title", "category"] }).map((x) => x.obj),
|
||||
false,
|
||||
),
|
||||
...fuzzysort.go(needle, popularProviders, { keys: ["title"] }).map((x) => x.obj),
|
||||
]
|
||||
}
|
||||
|
|
@ -188,6 +191,7 @@ export function sortModelOptions<T extends { footer?: string; releaseDate: strin
|
|||
return sortBy(
|
||||
options,
|
||||
(option) => option.footer !== "Free",
|
||||
[(option) => option.releaseDate, "desc"],
|
||||
(option) => option.title,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue