💚 Fix navigator share un-handled error

fixes MON-ENTREPRISEFR-T
pull/1647/head
Alexandre Hajjar 2021-06-21 18:18:21 +02:00
parent 39d742401c
commit 8b22fc18d3
1 changed files with 4 additions and 4 deletions

View File

@ -26,10 +26,10 @@ export default function ShareSimulationBanner() {
searchParams.toString(),
].join('')
const startSharing = () => {
const startSharing = async () => {
if (shareAPIAvailable) {
try {
window.navigator.share({
await window.navigator.share({
title: document.title,
text: t(
'shareSimulation.navigatorShare',
@ -73,14 +73,14 @@ export default function ShareSimulationBanner() {
<Trans i18nKey="shareSimulation.banner">
Pour partager cette simulation :{' '}
<LinkButton
onClick={() => {
onClick={async () => {
tracker.click.set({
chapter1: 'feature:partage',
type: 'action',
name: 'démarré',
})
tracker.dispatch()
startSharing()
await startSharing()
}}
>
Générer un lien dédié