Skip to content

Commit

Permalink
feat: catch share errors
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Jan 23, 2024
1 parent 7102b43 commit 2381718
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions components/shared/ShareButton.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts" setup>
import * as Sentry from '@sentry/vue'
import { ShareIcon } from '@heroicons/vue/24/outline'
interface ShareButtonProps {
Expand Down Expand Up @@ -36,11 +37,15 @@
* <url>
*/
await window.navigator.share({
title: props.title,
text: text,
url: props.url
})
try {
await window.navigator.share({
title: props.title,
text: text,
url: props.url
})
} catch (error) {
Sentry.captureException(error)
}
}
</script>

Expand Down

0 comments on commit 2381718

Please sign in to comment.