From 46277c74d5df376e4350cb3c8035ec9dda329a7a Mon Sep 17 00:00:00 2001
From: ekambains <bainseka@sheridancollege.ca>
Date: Sun, 13 Apr 2025 09:42:48 -0400
Subject: ui(web): Copy link button greyed out when clipboard not available
 (#1209)

* ui(web): Now the copy link button is greyed out when clipboard is not available

* Fix: handled navigator check safely
---
 apps/web/components/dashboard/bookmarks/BookmarkOptions.tsx | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'apps/web/components/dashboard/bookmarks/BookmarkOptions.tsx')

diff --git a/apps/web/components/dashboard/bookmarks/BookmarkOptions.tsx b/apps/web/components/dashboard/bookmarks/BookmarkOptions.tsx
index af746230..06bead4f 100644
--- a/apps/web/components/dashboard/bookmarks/BookmarkOptions.tsx
+++ b/apps/web/components/dashboard/bookmarks/BookmarkOptions.tsx
@@ -48,6 +48,7 @@ export default function BookmarkOptions({ bookmark }: { bookmark: ZBookmark }) {
   const linkId = bookmark.id;
 
   const demoMode = !!useClientConfig().demoMode;
+  const isClipboardAvailable = navigator && !!navigator.clipboard;
 
   const { setOpen: setManageListsModalOpen, content: manageListsModal } =
     useManageListsModal(bookmark.id);
@@ -196,6 +197,7 @@ export default function BookmarkOptions({ bookmark }: { bookmark: ZBookmark }) {
 
           {bookmark.content.type === BookmarkTypes.LINK && (
             <DropdownMenuItem
+              disabled={!isClipboardAvailable}
               onClick={() => {
                 navigator.clipboard.writeText(
                   (bookmark.content as ZBookmarkedLink).url,
-- 
cgit v1.2.3-70-g09d2

