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