diff --git a/frontend/src/components/AboutModal.tsx b/frontend/src/components/AboutModal.tsx index 28c4cb4..d295943 100644 --- a/frontend/src/components/AboutModal.tsx +++ b/frontend/src/components/AboutModal.tsx @@ -1,7 +1,6 @@ import { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { FRONTEND_VERSION, GITHUB_URL } from "../App"; -import { useEscapeKey } from "../hooks/useEscapeKey"; interface UpdateCheckResult { status: "up-to-date" | "update-available" | "error"; @@ -18,7 +17,7 @@ export default function AboutModal({ isOpen, onClose }: AboutModalProps) { const [isChecking, setIsChecking] = useState(false); const [updateCheckResult, setUpdateCheckResult] = useState(null); - useEscapeKey(isOpen, onClose); + // ESC is handled by the global handler in App.tsx to avoid double history.back() // Reset check result when modal opens so stale results are never shown useEffect(() => { diff --git a/frontend/src/components/ProfileModal.tsx b/frontend/src/components/ProfileModal.tsx index b0decc2..e793d93 100644 --- a/frontend/src/components/ProfileModal.tsx +++ b/frontend/src/components/ProfileModal.tsx @@ -1,4 +1,3 @@ -import { useEscapeKey } from "../hooks/useEscapeKey"; import { UserProfile } from "./Auth"; interface ProfileModalProps { @@ -7,7 +6,7 @@ interface ProfileModalProps { } export default function ProfileModal({ isOpen, onClose }: ProfileModalProps) { - useEscapeKey(isOpen, onClose); + // ESC is handled by the global handler in App.tsx to avoid double history.back() if (!isOpen) return null; diff --git a/frontend/src/components/ShareDialog.tsx b/frontend/src/components/ShareDialog.tsx index 85371f3..e0b90ec 100644 --- a/frontend/src/components/ShareDialog.tsx +++ b/frontend/src/components/ShareDialog.tsx @@ -5,7 +5,6 @@ import { Check, Copy, Link2, X } from "lucide-react"; import { useTranslation } from "react-i18next"; -import { useEscapeKey } from "../hooks/useEscapeKey"; export interface ShareDialogProps { show: boolean; @@ -44,7 +43,7 @@ export function ShareDialog({ const closeLabel = t("common.close"); const copyLabel = shareCopied ? t("share.copied") : t("share.copyLink"); - useEscapeKey(show, onClose); + // ESC is handled by the global handler in App.tsx to avoid double history.back() if (!show) return null;