Correción url compartir whatsapp #21

Merged
esteban merged 1 commits from shared-news into main 2026-03-10 12:12:30 +00:00
1 changed files with 1 additions and 9 deletions
Showing only changes of commit 4fcfb94ae7 - Show all commits

View File

@ -98,15 +98,7 @@ const copyLink = async () => {
console.error("No se pudo copiar") console.error("No se pudo copiar")
} }
} }
const BASE_URL = window.location.host const fullUrl = computed(() => window.location.href)
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 encodedUrl = computed(() => encodeURIComponent(fullUrl.value)) const encodedUrl = computed(() => encodeURIComponent(fullUrl.value))
const twitterUrl = computed(() => `https://twitter.com/intent/tweet?url=${encodedUrl.value}`) const twitterUrl = computed(() => `https://twitter.com/intent/tweet?url=${encodedUrl.value}`)