From d009b000120121430aaafe400423c91cd7baef38 Mon Sep 17 00:00:00 2001 From: "G.Wood-Sun" Date: Tue, 27 May 2025 11:33:48 +0800 Subject: [PATCH] fix: fix option check --- app/components/welcome/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/components/welcome/index.tsx b/app/components/welcome/index.tsx index 9b18105..b795261 100644 --- a/app/components/welcome/index.tsx +++ b/app/components/welcome/index.tsx @@ -177,7 +177,10 @@ const Welcome: FC = ({ const canChat = () => { const inputLens = Object.values(inputs).length const promptVariablesLens = promptConfig.prompt_variables.length - const emptyInput = inputLens < promptVariablesLens || Object.values(inputs).filter(v => v === '').length > 0 + const emptyInput = inputLens < promptVariablesLens || Object.entries(inputs).filter(([k, v]) => { + const isRequired = promptConfig.prompt_variables.find(item => item.key === k)?.required ?? true + return isRequired && v === '' + }).length > 0 if (emptyInput) { logError(t('app.errorMessage.valueOfVarRequired')) return false