Skip to content

Commit

Permalink
Merge pull request #8023 from nocodb/fix/8022-copy-url
Browse files Browse the repository at this point in the history
fix: Use useCopy composable for copying content to clipboard
  • Loading branch information
pranavxc committed Apr 2, 2024
2 parents a9e4770 + 72e013a commit 7194216
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/nc-gui/components/general/CopyUrl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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(`<iframe src="${url.value}" width="100%" height="100%" style="border: none;"></iframe>`)
await copy(`<iframe src="${url.value}" width="100%" height="100%" style="border: none;"></iframe>`)
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
Expand Down

0 comments on commit 7194216

Please sign in to comment.