fix: remove global Enter key listener from RestoreTaskDialog to prevent accidental restores

This commit is contained in:
Roo Code 2026-01-23 15:00:51 +00:00 committed by Hannes Rudolph
parent 2766839dcc
commit 61f49d724c

View file

@ -1,5 +1,4 @@
import { useCallback, useEffect } from "react"
import { useKeyPress } from "react-use"
import { useCallback } from "react"
import { AlertDialogProps } from "@radix-ui/react-alert-dialog"
import {
@ -19,7 +18,6 @@ import { vscode } from "@/utils/vscode"
export const RestoreTaskDialog = ({ ...props }: AlertDialogProps) => {
const { t } = useAppTranslation()
const [isEnterPressed] = useKeyPress("Enter")
const { onOpenChange } = props
@ -28,12 +26,6 @@ export const RestoreTaskDialog = ({ ...props }: AlertDialogProps) => {
onOpenChange?.(false)
}, [onOpenChange])
useEffect(() => {
if (props.open && isEnterPressed) {
onRestore()
}
}, [props.open, isEnterPressed, onRestore])
return (
<AlertDialog {...props}>
<AlertDialogContent onEscapeKeyDown={() => onOpenChange?.(false)}>