Skip to content

Commit 68f50fa

Browse files
committed
fix
1 parent 474c177 commit 68f50fa

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

webview-ui/src/components/settings/RateLimitControl.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react"
2-
import { useEffect, useState } from "react"
2+
import { useEffect, useState, FormEvent } from "react"
33
import { useAppTranslation } from "@/i18n/TranslationContext"
44
import { useDebounce } from "react-use"
55

@@ -26,8 +26,10 @@ export const RateLimitControl = ({ value, onChange, maxValue = 60 }: RateLimitCo
2626
<div>
2727
<VSCodeCheckbox
2828
checked={isCustomRateLimit}
29-
onChange={(e: any) => {
30-
const isChecked = e.target.checked
29+
onChange={(e: Event | FormEvent<HTMLElement>) => {
30+
const target = ("target" in e ? e.target : null) as HTMLInputElement | null
31+
if (!target) return
32+
const isChecked = target.checked
3133
setIsCustomRateLimit(isChecked)
3234
if (!isChecked) {
3335
setInputValue(null) // Unset the rate limit, note that undefined is unserializable

0 commit comments

Comments
 (0)