From c124ab3299d2bec0e1c65765b314292d9b47a7b3 Mon Sep 17 00:00:00 2001 From: newraina Date: Sat, 7 Oct 2023 11:47:35 +0900 Subject: [PATCH 1/2] enable clipboard directive to support value updates --- plugins/vueClipboard.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/vueClipboard.ts b/plugins/vueClipboard.ts index b3d30429eb..21580470db 100644 --- a/plugins/vueClipboard.ts +++ b/plugins/vueClipboard.ts @@ -3,14 +3,22 @@ export default defineNuxtPlugin((nuxtApp) => { nuxtApp.vueApp.directive('clipboard', { beforeMount(el, { value, arg }) { + el.dataset._clipboard_value = value useEventListener(el, 'click', () => { switch (arg) { case 'copy': - copy(value) + copy(el.dataset._clipboard_value) break } }) }, + updated(el, { value, arg }) { + switch (arg) { + case 'copy': + el.dataset._clipboard_value = value + break + } + }, }) return { From d6f56f10097c1aa887e2b5d0d993fb86db65cf25 Mon Sep 17 00:00:00 2001 From: newraina Date: Sat, 7 Oct 2023 11:49:23 +0900 Subject: [PATCH 2/2] fix: make recurringPaymentLink reactive --- components/transfer/Transfer.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/transfer/Transfer.vue b/components/transfer/Transfer.vue index db76c18bc0..57759ed966 100644 --- a/components/transfer/Transfer.vue +++ b/components/transfer/Transfer.vue @@ -45,7 +45,7 @@ @@ -830,13 +830,13 @@ const onTxError = async (dispatchError: DispatchError): Promise => { isLoading.value = false } -const generateRecurringPaymentLink = () => { +const recurringPaymentLink = computed(() => { const addressList = targetAddresses.value .filter((item) => isAddress(item.address) && !item.isInvalid) .map((item) => item.address) return generatePaymentLink(addressList) -} +}) const generatePaymentLink = (addressList: string[]): string => { const url = new URL(`${location.origin}${location.pathname}`)