From 0dbc018c8d4bfb7d2fd98e19d5c1915ffd26600f Mon Sep 17 00:00:00 2001 From: Matthew Aaron Raymer Date: Sat, 13 May 2023 11:19:53 +0800 Subject: [PATCH 1/4] A bit of infinity and hack for copy message --- src/components/InfiniteScroll.vue | 42 +++++++++++++++++ src/views/AccountViewView.vue | 75 ++++++++++++++++++++++++++++--- 2 files changed, 112 insertions(+), 5 deletions(-) create mode 100644 src/components/InfiniteScroll.vue diff --git a/src/components/InfiniteScroll.vue b/src/components/InfiniteScroll.vue new file mode 100644 index 0000000..2afdb9e --- /dev/null +++ b/src/components/InfiniteScroll.vue @@ -0,0 +1,42 @@ + + + + + + diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue index f9cce60..6f63eb3 100644 --- a/src/views/AccountViewView.vue +++ b/src/views/AccountViewView.vue @@ -89,7 +89,16 @@
ID
{{ activeDid }} - @@ -104,30 +113,52 @@ + Copied!
Public Key (base 64)
{{ publicBase64 }} - + Copied!
Public Key (hex)
{{ publicHex }} - + Copied!
Derivation Path
{{ derivationPath }} - + Copied!
@@ -288,7 +319,38 @@ export default class AccountViewView extends Vue { limits: RateLimits | null = null; showContactGives = false; + did = false; + derpath = false; + base64 = false; + pubhex = false; + copy = useClipboard().copy; + text = useClipboard().text; + + showCopyMessage() { + this.did = true; + } + + st(f) { + setTimeout(f, 10000); + } + + copyText = (e: MouseEvent, inputText: string, loc: string) => { + console.log(this); + console.log(e, inputText); + this.copy(inputText).then(() => { + if (loc == "did") { + this.showCopyMessage(); + console.log(this); + } else if (loc == "derpath") { + this.derpath = true; + } else if (loc == "base64") { + this.base64 = true; + } else if (loc == "pubhex") { + this.pubhex = true; + } + }); + }; handleChange() { this.showContactGives = !this.showContactGives; @@ -299,6 +361,9 @@ export default class AccountViewView extends Vue { return timeStr.substring(0, timeStr.indexOf("T")); } + mounted() { + console.log("Mounted", this); + } // 'created' hook runs when the Vue instance is first created async created() { // Uncomment to register this user on the test server. @@ -306,7 +371,7 @@ export default class AccountViewView extends Vue { // assign this to a class variable, eg. "registerThisUser = testServerRegisterUser", // select a component in the extension, and enter in the console: $vm.ctx.registerThisUser() //testServerRegisterUser(); - + console.log("created", this); try { await db.open(); const settings = await db.settings.get(MASTER_SETTINGS_KEY); From 44ed39b5c1700ca66b2e3d50e5d699b15ffcf543 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Fri, 12 May 2023 21:40:10 -0600 Subject: [PATCH 2/4] eliminate extra code for quick-message-display --- src/views/AccountViewView.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue index 6f63eb3..b448d41 100644 --- a/src/views/AccountViewView.vue +++ b/src/views/AccountViewView.vue @@ -151,8 +151,12 @@ {{ derivationPath }} + Copied! - Copied!
Public Key (base 64)
@@ -121,14 +117,13 @@ {{ publicBase64 }} - Copied! + Copied!
Public Key (hex)
@@ -136,14 +131,13 @@ {{ publicHex }} - Copied! + Copied!
Derivation Path
@@ -151,18 +145,13 @@ {{ derivationPath }} - Copied! + Copied! @@ -323,37 +312,19 @@ export default class AccountViewView extends Vue { limits: RateLimits | null = null; showContactGives = false; - did = false; - derpath = false; - base64 = false; - pubhex = false; - - copy = useClipboard().copy; - text = useClipboard().text; - - showCopyMessage() { - this.did = true; - } - - st(f) { - setTimeout(f, 2000); + showDidCopy = false; + showDerCopy = false; + showB64Copy = false; + showPubCopy = false; + + // call fn, copy text to the clipboard, then redo fn after 2 seconds + doCopyTwoSecRedo(text, fn) { + fn(); + useClipboard() + .copy(text) + .then(() => setTimeout(fn, 2000)); } - copyText = (e: MouseEvent, inputText: string, loc: string) => { - console.log(this); - console.log(e, inputText); - this.copy(inputText).then(() => { - if (loc == "did") { - this.showCopyMessage(); - console.log(this); - } else if (loc == "base64") { - this.base64 = true; - } else if (loc == "pubhex") { - this.pubhex = true; - } - }); - }; - handleChange() { this.showContactGives = !this.showContactGives; this.updateShowContactAmounts(); From e4f3f9b2e010ce0e8c535cf529765f662d4eee59 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Mon, 15 May 2023 16:45:22 -0600 Subject: [PATCH 4/4] remove extra logging --- src/views/AccountViewView.vue | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue index b128074..9a9f87e 100644 --- a/src/views/AccountViewView.vue +++ b/src/views/AccountViewView.vue @@ -334,9 +334,6 @@ export default class AccountViewView extends Vue { return timeStr.substring(0, timeStr.indexOf("T")); } - mounted() { - console.log("Mounted", this); - } // 'created' hook runs when the Vue instance is first created async created() { // Uncomment to register this user on the test server. @@ -344,7 +341,6 @@ export default class AccountViewView extends Vue { // assign this to a class variable, eg. "registerThisUser = testServerRegisterUser", // select a component in the extension, and enter in the console: $vm.ctx.registerThisUser() //testServerRegisterUser(); - console.log("created", this); try { await db.open(); const settings = await db.settings.get(MASTER_SETTINGS_KEY);