fix(LMStudioSettings): prevent negative values in keepAliveMinutes input (#7868)

fix(LMStudioSettings): 修复keepAliveMinutes输入为负数的问题

确保输入值通过Math.floor处理且最小值为0,避免负数输入
This commit is contained in:
Phantom 2025-07-06 15:42:22 +08:00 committed by GitHub
parent a4620f8c68
commit 4c81efc5b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,7 +17,8 @@ const LMStudioSettings: FC = () => {
<InputNumber
style={{ width: '100%' }}
value={keepAliveMinutes}
onChange={(e) => setKeepAliveMinutes(Number(e))}
min={0}
onChange={(e) => setKeepAliveMinutes(Math.floor(Number(e)))}
onBlur={() => setKeepAliveTime(keepAliveMinutes)}
suffix={t('lmstudio.keep_alive_time.placeholder')}
step={5}