Skip to content

Commit

Permalink
fix: model parameter load presets config (langgenius#2622)
Browse files Browse the repository at this point in the history
  • Loading branch information
zxhlyh authored Feb 29, 2024
1 parent 88a095e commit 7beff3f
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ const ParameterItem: FC<ParameterItemProps> = ({
}
}

useEffect(() => {
if ((parameterRule.type === 'int' || parameterRule.type === 'float') && numberInputRef.current)
numberInputRef.current.value = `${renderValue}`
}, [value])

const renderInput = () => {
const numberInputWithSlide = (parameterRule.type === 'int' || parameterRule.type === 'float')
&& !isNullOrUndefined(parameterRule.min)
Expand Down Expand Up @@ -207,11 +212,6 @@ const ParameterItem: FC<ParameterItemProps> = ({
return null
}

useEffect(() => {
if (numberInputRef.current)
numberInputRef.current.value = `${renderValue}`
}, [])

return (
<div className={`flex items-center justify-between ${className}`}>
<div>
Expand Down

0 comments on commit 7beff3f

Please sign in to comment.