From 72e013a8d96e82dc22679c4ffa460c2ca01fe7bc Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 2 Apr 2024 14:14:52 +0530 Subject: [PATCH] fix: use `useCopy` composable for copying content to clipboard Signed-off-by: Pranav C --- packages/nc-gui/components/general/CopyUrl.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/components/general/CopyUrl.vue b/packages/nc-gui/components/general/CopyUrl.vue index c51f6a037e..bf67aab1e6 100644 --- a/packages/nc-gui/components/general/CopyUrl.vue +++ b/packages/nc-gui/components/general/CopyUrl.vue @@ -12,19 +12,21 @@ const isCopied = ref({ embed: false, }) +const { copy } = useCopy() + const openUrl = async () => { window.open(url.value, '_blank', 'noopener,noreferrer') } const embedHtml = async () => { - await navigator.clipboard.writeText(``) + await copy(``) isCopied.value.embed = true } const copyUrl = async () => { isCopied.value.link = false - await navigator.clipboard.writeText(url.value) + await copy(url.value) setTimeout(() => { isCopied.value.link = true