🐛 Fallback en cas d'erreur sur l'API de partage
parent
145080f3af
commit
496c58c00e
|
@ -28,14 +28,18 @@ export default function ShareSimulationBanner() {
|
|||
|
||||
const startSharing = () => {
|
||||
if (shareAPIAvailable) {
|
||||
window.navigator.share({
|
||||
title: document.title,
|
||||
text: t(
|
||||
'shareSimulation.navigatorShare',
|
||||
'Ma simulation Mon Entreprise'
|
||||
),
|
||||
url: getUrl(),
|
||||
})
|
||||
try {
|
||||
window.navigator.share({
|
||||
title: document.title,
|
||||
text: t(
|
||||
'shareSimulation.navigatorShare',
|
||||
'Ma simulation Mon Entreprise'
|
||||
),
|
||||
url: getUrl(),
|
||||
})
|
||||
} catch {
|
||||
setOpened(true)
|
||||
}
|
||||
} else {
|
||||
setOpened(true)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue