Sort models alphabetically in Chat view
Signed-off-by: Fred Bricon <fbricon@gmail.com>
This commit is contained in:
parent
4e8a69ec30
commit
88e3fbbc98
1 changed files with 3 additions and 2 deletions
|
|
@ -131,8 +131,9 @@ function ModelSelect() {
|
|||
|
||||
// Sort so that options without an API key are at the end
|
||||
useEffect(() => {
|
||||
const enabledOptions = options.filter((option) => option.apiKey !== "");
|
||||
const disabledOptions = options.filter((option) => option.apiKey === "");
|
||||
const alphaSort = options.sort((a, b) => a.title.localeCompare(b.title));
|
||||
const enabledOptions = alphaSort.filter((option) => option.apiKey !== "");
|
||||
const disabledOptions = alphaSort.filter((option) => option.apiKey === "");
|
||||
|
||||
const sorted = [...enabledOptions, ...disabledOptions];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue