diff --git a/app/store/app.ts b/app/store/app.ts index 118e9ed6..6ab3229a 100644 --- a/app/store/app.ts +++ b/app/store/app.ts @@ -89,7 +89,9 @@ export function isValidNumber(x: number, min: number, max: number) { return typeof x === "number" && x <= max && x >= min; } -export function filterConfig(config: ModelConfig): Partial { +export function filterConfig(oldConfig: ModelConfig): Partial { + const config = Object.assign({}, oldConfig); + const validator: { [k in keyof ModelConfig]: (x: ModelConfig[keyof ModelConfig]) => boolean; } = { @@ -103,7 +105,7 @@ export function filterConfig(config: ModelConfig): Partial { return isValidNumber(x as number, -2, 2); }, temperature(x) { - return isValidNumber(x as number, 0, 1); + return isValidNumber(x as number, 0, 2); }, };