ソースを参照

fix: do not submit value when file input is optional (#17861)

tags/1.3.0
KVOJJJin 6ヶ月前
コミット
78da4ca024
コミッターのメールアドレスに関連付けられたアカウントが存在しません
1個のファイルの変更8行の追加2行の削除
  1. 8
    2
      web/app/components/share/text-generation/run-once/index.tsx

+ 8
- 2
web/app/components/share/text-generation/run-once/index.tsx ファイルの表示

@@ -45,7 +45,10 @@ const RunOnce: FC<IRunOnceProps> = ({
const onClear = () => {
const newInputs: Record<string, any> = {}
promptConfig.prompt_variables.forEach((item) => {
newInputs[item.key] = ''
if (item.type === 'text-input' || item.type === 'paragraph')
newInputs[item.key] = ''
else
newInputs[item.key] = undefined
})
onInputsChange(newInputs)
}
@@ -63,7 +66,10 @@ const RunOnce: FC<IRunOnceProps> = ({
useEffect(() => {
const newInputs: Record<string, any> = {}
promptConfig.prompt_variables.forEach((item) => {
newInputs[item.key] = ''
if (item.type === 'text-input' || item.type === 'paragraph')
newInputs[item.key] = ''
else
newInputs[item.key] = undefined
})
onInputsChange(newInputs)
}, [promptConfig.prompt_variables, onInputsChange])

読み込み中…
キャンセル
保存