mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-08 22:21:23 +00:00
fix: remove global Enter key listener from RestoreTaskDialog to prevent accidental restores
This commit is contained in:
parent
2766839dcc
commit
61f49d724c
1 changed files with 1 additions and 9 deletions
|
|
@ -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)}>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue