From 68115cbf2f1c5e32c3aa2f407c4fbfb415a8fadb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ars=C3=A8ne=20Reymond?= <66876397+p0lycarpio@users.noreply.github.com> Date: Mon, 7 Jul 2025 09:32:34 +0200 Subject: [PATCH] fix: AppButtonCopy errors in tooltip & console (#5612) Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com> --- frontend/components/global/AppButtonCopy.vue | 26 +++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/frontend/components/global/AppButtonCopy.vue b/frontend/components/global/AppButtonCopy.vue index 674d43c88..9538ee349 100644 --- a/frontend/components/global/AppButtonCopy.vue +++ b/frontend/components/global/AppButtonCopy.vue @@ -2,7 +2,6 @@ - - + + {{ $globals.icons.clipboardCheck }} {{ $t("general.your-browser-does-not-support-clipboard") }} - {{ copied ? $t("general.copied_message") : $t("general.clipboard-copy-failure") }} + {{ copiedSuccess ? $t("general.copied_message") : $t("general.clipboard-copy-failure") }} @@ -63,19 +59,18 @@ export default defineNuxtComponent({ const { copy, copied, isSupported } = useClipboard(); const show = ref(false); const copyToolTip = ref(null); - - function toggleBlur() { - copyToolTip.value?.deactivate(); - } + const copiedSuccess = ref(null); async function textToClipboard() { if (isSupported.value) { await copy(props.copyText); if (copied.value) { - console.log(`Copied\n${props.copyText}`); + copiedSuccess.value = true; + console.info(`Copied\n${props.copyText}`); } else { - console.warn("Copy failed: ", copied.value); + copiedSuccess.value = false; + console.error("Copy failed: ", copied.value); } } else { @@ -84,8 +79,8 @@ export default defineNuxtComponent({ show.value = true; setTimeout(() => { - toggleBlur(); - }, 500); + show.value = false; + }, 3000); } return { @@ -94,6 +89,7 @@ export default defineNuxtComponent({ textToClipboard, copied, isSupported, + copiedSuccess, }; }, });