diff --git a/src/app/components/DeviceVerificationSetup.tsx b/src/app/components/DeviceVerificationSetup.tsx index 0d02cc347..b0308b866 100644 --- a/src/app/components/DeviceVerificationSetup.tsx +++ b/src/app/components/DeviceVerificationSetup.tsx @@ -19,7 +19,7 @@ import { useSaveFile } from '../hooks/useSaveFile'; import { useModalStyle } from '../hooks/useModalStyle'; import { PasswordInput } from './password-input'; import { ContainerColor } from '../styles/ContainerColor.css'; -import { copyToClipboard } from '../utils/dom'; +import { useSensitiveCopy } from '../hooks/useSensitiveCopy'; import { AsyncStatus, useAsyncCallback } from '../hooks/useAsyncCallback'; import { clearSecretStorageKeys } from '../../client/secretStorageKeys'; import { ActionUIA, ActionUIAFlowsLoader } from './ActionUIA'; @@ -232,9 +232,8 @@ function RecoveryKeyDisplay({ recoveryKey }: RecoveryKeyDisplayProps) { const [show, setShow] = useState(false); const saveFile = useSaveFile(); - const handleCopy = () => { - copyToClipboard(recoveryKey); - }; + // [Gitea #156] The key leaves the clipboard again after 60 s, visibly. + const { copy: handleCopy, secondsLeft } = useSensitiveCopy(recoveryKey); const handleDownload = () => { const blob = new Blob([recoveryKey], { @@ -272,8 +271,10 @@ function RecoveryKeyDisplay({ recoveryKey }: RecoveryKeyDisplayProps) { -