Merge pull request #2947 from KeithHello/main

This commit is contained in:
Yifei Zhang 2023-10-09 22:45:56 +08:00 committed by GitHub
commit fd413c7b52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 7 deletions

View File

@ -1,6 +1,3 @@
import { create } from "zustand";
import { persist } from "zustand/middleware";
import { trimTopic } from "../utils"; import { trimTopic } from "../utils";
import Locale, { getLang } from "../locales"; import Locale, { getLang } from "../locales";

View File

@ -70,7 +70,7 @@ export function limitNumber(
max: number, max: number,
defaultValue: number, defaultValue: number,
) { ) {
if (typeof x !== "number" || isNaN(x)) { if (isNaN(x)) {
return defaultValue; return defaultValue;
} }
@ -133,9 +133,7 @@ export const useAppConfig = createPersistStore(
.customModels.split(",") .customModels.split(",")
.filter((v) => !!v && v.length > 0) .filter((v) => !!v && v.length > 0)
.map((m) => ({ name: m, available: true })); .map((m) => ({ name: m, available: true }));
return get().models.concat(customModels);
const models = get().models.concat(customModels);
return models;
}, },
}), }),
{ {