feat: sort model by name

This commit is contained in:
Yidadaa 2023-11-08 01:04:20 +08:00
parent c7321fddfb
commit 54a5332834

View File

@ -133,7 +133,9 @@ export const useAppConfig = createPersistStore(
.customModels.split(",")
.filter((v) => !!v && v.length > 0)
.map((m) => ({ name: m, available: true }));
return get().models.concat(customModels);
const allModels = get().models.concat(customModels);
allModels.sort((a, b) => (a.name < b.name ? -1 : 1));
return allModels;
},
}),
{