diff --git a/src/utils/shareUtils.js b/src/utils/shareUtils.js index 1d0a605c7..791723f8a 100644 --- a/src/utils/shareUtils.js +++ b/src/utils/shareUtils.js @@ -175,13 +175,14 @@ export const generateEventSharingData = (event, baseUrl = null) => { * @returns {Promise} Success status */ export const copyToClipboard = async (text) => { - if (typeof window === "undefined" || typeof document === "undefined") { + if (typeof document === "undefined") { return false; } try { - if (navigator.clipboard) { - await navigator.clipboard.writeText(text); + const clipboard = globalThis.navigator?.clipboard; + if (clipboard) { + await clipboard.writeText(text); return true; } else { // Fallback for older browsers