Skip to content

Commit 61f49d7

Browse files
roomotehannesrudolph
authored andcommitted
fix: remove global Enter key listener from RestoreTaskDialog to prevent accidental restores
1 parent 2766839 commit 61f49d7

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

webview-ui/src/components/chat/RestoreTaskDialog.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { useCallback, useEffect } from "react"
2-
import { useKeyPress } from "react-use"
1+
import { useCallback } from "react"
32
import { AlertDialogProps } from "@radix-ui/react-alert-dialog"
43

54
import {
@@ -19,7 +18,6 @@ import { vscode } from "@/utils/vscode"
1918

2019
export const RestoreTaskDialog = ({ ...props }: AlertDialogProps) => {
2120
const { t } = useAppTranslation()
22-
const [isEnterPressed] = useKeyPress("Enter")
2321

2422
const { onOpenChange } = props
2523

@@ -28,12 +26,6 @@ export const RestoreTaskDialog = ({ ...props }: AlertDialogProps) => {
2826
onOpenChange?.(false)
2927
}, [onOpenChange])
3028

31-
useEffect(() => {
32-
if (props.open && isEnterPressed) {
33-
onRestore()
34-
}
35-
}, [props.open, isEnterPressed, onRestore])
36-
3729
return (
3830
<AlertDialog {...props}>
3931
<AlertDialogContent onEscapeKeyDown={() => onOpenChange?.(false)}>

0 commit comments

Comments
 (0)