diff --git a/src/components/map/places-map.tsx b/src/components/map/places-map.tsx index f337cfa..1a57708 100644 --- a/src/components/map/places-map.tsx +++ b/src/components/map/places-map.tsx @@ -253,6 +253,10 @@ export function PlacesMap({ places }: PlacesMapProps) { lng: viewport?.lng ?? null, zoom: viewport?.zoom ?? null, }); + if (!("clipboard" in navigator)) { + toast.error("Copying isn't supported in this browser"); + return; + } navigator.clipboard .writeText(url) .then(() => toast.success("Link copied")) diff --git a/src/components/pins/pin-popup.tsx b/src/components/pins/pin-popup.tsx index d7321c1..21063cd 100644 --- a/src/components/pins/pin-popup.tsx +++ b/src/components/pins/pin-popup.tsx @@ -32,6 +32,10 @@ export function PinPopup({ place }: PinPopupProps) { lng: place.lng, zoom: 15, }); + if (!("clipboard" in navigator)) { + toast.error("Copying isn't supported in this browser"); + return; + } navigator.clipboard .writeText(url) .then(() => toast.success("Link copied"))