From 79669f69612c4df93786219b1da728156978006e Mon Sep 17 00:00:00 2001 From: Dicki Date: Tue, 26 Apr 2022 16:30:54 +0700 Subject: [PATCH 1/2] feat: Add mnemonic copy button --- src/components/SecretBackupPhraseDialog.vue | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/components/SecretBackupPhraseDialog.vue b/src/components/SecretBackupPhraseDialog.vue index a1bdc15f..2069fa0a 100644 --- a/src/components/SecretBackupPhraseDialog.vue +++ b/src/components/SecretBackupPhraseDialog.vue @@ -17,13 +17,17 @@ mdi-close - + -

+

Write down these words in the right order and save them safely

+

+ mdi-content-copy {{ copyText }} +

({ mnemonic: "", + copyText: "Copy this Mnemonic Phrase to clipboard", mnemonicCollection: [] }), computed: { @@ -92,6 +99,15 @@ export default { const hasAddress = localStorage.getLocalStorageByName("mnemonic_data") if (!hasAddress) localStorage.removeLocalStorageByName("TERMS") + }, + async handleCopyMnemonic() { + await navigator.clipboard.writeText(this.mnemonic) + this.copyText = "Your mnemonic has been copied successfully !" + + clearTimeout(timeout) + timeout = setTimeout(() => { + this.copyText = "Copy this Mnemonic Phrase to clipboard" + }, 1000) } } } From f53417cbde6f5dd6489afdec7864f80340670d07 Mon Sep 17 00:00:00 2001 From: Dicki Date: Tue, 26 Apr 2022 16:47:08 +0700 Subject: [PATCH 2/2] Minor update wording --- src/components/SecretBackupPhraseDialog.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/SecretBackupPhraseDialog.vue b/src/components/SecretBackupPhraseDialog.vue index 2069fa0a..4aa1d1e0 100644 --- a/src/components/SecretBackupPhraseDialog.vue +++ b/src/components/SecretBackupPhraseDialog.vue @@ -102,7 +102,7 @@ export default { }, async handleCopyMnemonic() { await navigator.clipboard.writeText(this.mnemonic) - this.copyText = "Your mnemonic has been copied successfully !" + this.copyText = "Mnemonic has been copied successfully !" clearTimeout(timeout) timeout = setTimeout(() => {