fix: remove timeout state for copying recovery phrase
This commit is contained in:
parent
573855fc0f
commit
08bcb779ca
|
@ -15,7 +15,6 @@ type RecoveryPhraseProps = {
|
||||||
const RecoveryPhrase = ({ isKeystoreFiles }: RecoveryPhraseProps) => {
|
const RecoveryPhrase = ({ isKeystoreFiles }: RecoveryPhraseProps) => {
|
||||||
const [isReveal, setIsReveal] = useState(false)
|
const [isReveal, setIsReveal] = useState(false)
|
||||||
const [isCopied, setIsCopied] = useState(false)
|
const [isCopied, setIsCopied] = useState(false)
|
||||||
const [isTimeoutActive, setIsTimeoutActive] = useState(false)
|
|
||||||
const { generatedMnemonic } = useSelector((state: RootState) => state.keyGeneration)
|
const { generatedMnemonic } = useSelector((state: RootState) => state.keyGeneration)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -29,13 +28,11 @@ const RecoveryPhrase = ({ isKeystoreFiles }: RecoveryPhraseProps) => {
|
||||||
const copyRecoveryPhraseHandler = () => {
|
const copyRecoveryPhraseHandler = () => {
|
||||||
copyFunction(generatedMnemonic.join(' '))
|
copyFunction(generatedMnemonic.join(' '))
|
||||||
|
|
||||||
if (!isTimeoutActive) {
|
if (isCopied === false) {
|
||||||
setIsCopied(true)
|
setIsCopied(true)
|
||||||
setIsTimeoutActive(true)
|
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setIsCopied(false)
|
setIsCopied(false)
|
||||||
setIsTimeoutActive(false)
|
|
||||||
}, 3000)
|
}, 3000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue