From 6b6c0394b57117bdec69b3f19bfca73b88aeaae0 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 1 Feb 2024 21:47:08 +0000 Subject: [PATCH] fix: add fallback for link --- app.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.vue b/app.vue index f51e1ce..221cc84 100644 --- a/app.vue +++ b/app.vue @@ -211,7 +211,7 @@ function navigateToNewDomain () { return navigateTo('/' + withoutLeadingSlash(host).toLowerCase().replace(/(\/|\?).*$/, '').trim()) } -const shareLink = computed(() => `https://twitter.com/intent/tweet?text=${encodeURIComponent(`Check out the Page Speed results for ${domain.value.replace(/\./g, '.\x00')}` + `\n\nhttps://page-speed.dev/${domain.value}`)}`) +const shareLink = computed(() => domain.value ? `https://twitter.com/intent/tweet?text=${encodeURIComponent(`Check out the Page Speed results for ${domain.value.replace(/\./g, '.\x00')}` + `\n\nhttps://page-speed.dev/${domain.value}`)}` : 'See and share PageSpeed Insights results simply and easily.') async function nativeShare () { try {