fix: remove timeout state for copying recovery phrase

This commit is contained in:
RadoslavDimchev 2024-01-22 14:38:46 +02:00
parent 573855fc0f
commit 08bcb779ca
1 changed files with 1 additions and 4 deletions

View File

@ -15,7 +15,6 @@ type RecoveryPhraseProps = {
const RecoveryPhrase = ({ isKeystoreFiles }: RecoveryPhraseProps) => {
const [isReveal, setIsReveal] = useState(false)
const [isCopied, setIsCopied] = useState(false)
const [isTimeoutActive, setIsTimeoutActive] = useState(false)
const { generatedMnemonic } = useSelector((state: RootState) => state.keyGeneration)
useEffect(() => {
@ -29,13 +28,11 @@ const RecoveryPhrase = ({ isKeystoreFiles }: RecoveryPhraseProps) => {
const copyRecoveryPhraseHandler = () => {
copyFunction(generatedMnemonic.join(' '))
if (!isTimeoutActive) {
if (isCopied === false) {
setIsCopied(true)
setIsTimeoutActive(true)
setTimeout(() => {
setIsCopied(false)
setIsTimeoutActive(false)
}, 3000)
}
}