From 54a53328341af2d07db19e56db5febdaac225a87 Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Wed, 8 Nov 2023 01:04:20 +0800 Subject: [PATCH] feat: sort model by name --- app/store/config.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/store/config.ts b/app/store/config.ts index 184355c94a3..0fbc26dfe0e 100644 --- a/app/store/config.ts +++ b/app/store/config.ts @@ -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; }, }), {