Merge pull request 'Correción url compartir whatsapp' (#21) from shared-news into main

Reviewed-on: #21
This commit is contained in:
Esteban Paz 2026-03-10 12:12:29 +00:00
commit f6ef73988e
1 changed files with 1 additions and 9 deletions

View File

@ -98,15 +98,7 @@ const copyLink = async () => {
console.error("No se pudo copiar")
}
}
const BASE_URL = window.location.host
const fullUrl = computed(() => {
if (props.url.startsWith("http")) {
const url = new URL(props.url)
return `${BASE_URL}${url.pathname}`
}
return `${BASE_URL}${props.url}`
})
const fullUrl = computed(() => window.location.href)
const encodedUrl = computed(() => encodeURIComponent(fullUrl.value))
const twitterUrl = computed(() => `https://twitter.com/intent/tweet?url=${encodedUrl.value}`)