fix: remove unused keyRepeatTimeoutRef

This commit is contained in:
lugnicca 2025-08-23 18:32:12 +02:00
parent 639bd5fb27
commit 6c0e6dce06

View File

@ -137,7 +137,6 @@ function useKeyboardNavigation(
onModelSelect: (model: string) => void,
dropdownRef: React.RefObject<HTMLDivElement | null>
) {
const keyRepeatTimeoutRef = useRef<NodeJS.Timeout | null>(null)
// Scroll to the highlighted element
useEffect(() => {
@ -204,16 +203,6 @@ function useKeyboardNavigation(
}
}, [open, setOpen, models.length, filteredModels, highlightedIndex, setHighlightedIndex, onModelSelect])
// Cleanup the timeout
useEffect(() => {
const timeoutId = keyRepeatTimeoutRef.current
return () => {
if (timeoutId) {
clearTimeout(timeoutId)
}
}
}, [])
return { handleKeyDown }
}