Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: input not set min or max null value blur would set null (#2361)

Joelf95839c78533
diff --git a/web/app/components/header/account-setting/model-provider-page/model-modal/Input.tsx b/web/app/components/header/account-setting/model-provider-page/model-modal/Input.tsx
index c4ee3829cd8..55a5767b77a 100644
--- a/web/app/components/header/account-setting/model-provider-page/model-modal/Input.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/model-modal/Input.tsx
@@ -26,12 +26,14 @@ const Input: FC<InputProps> = ({
max,
}) => {
const toLimit = (v: string) => {
- if (min !== undefined && parseFloat(v) < min) {
+ const minNum = parseFloat(`${min}`)
+ const maxNum = parseFloat(`${max}`)
+ if (!isNaN(minNum) && parseFloat(v) < minNum) {
onChange(`${min}`)
return
}
- if (max !== undefined && parseFloat(v) > max)
+ if (!isNaN(maxNum) && parseFloat(v) > maxNum)
onChange(`${max}`)
}
return (