feat: reset is copied after 3 seconds copy
This commit is contained in:
parent
5ca47a8ced
commit
4a7d2222aa
|
@ -17,6 +17,7 @@ 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)
|
||||
const dispatch = useDispatch()
|
||||
|
||||
|
@ -41,7 +42,15 @@ const RecoveryPhrase = ({ isKeystoreFiles }: RecoveryPhraseProps) => {
|
|||
const text = generatedMnemonic.join(' ')
|
||||
navigator.clipboard.writeText(text)
|
||||
|
||||
setIsCopied(true)
|
||||
if (!isTimeoutActive) {
|
||||
setIsCopied(true)
|
||||
setIsTimeoutActive(true)
|
||||
|
||||
setTimeout(() => {
|
||||
setIsCopied(false)
|
||||
setIsTimeoutActive(false)
|
||||
}, 3000)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
Loading…
Reference in New Issue