From 3e24b09c51846057483ce9677909aa58682f5864 Mon Sep 17 00:00:00 2001 From: mrunalC27 Date: Mon, 18 May 2026 06:10:39 +0530 Subject: [PATCH] fix: add aria-label and error handling to copy profile URL button --- src/app/dashboard/settings/page.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/app/dashboard/settings/page.tsx b/src/app/dashboard/settings/page.tsx index 9e9a3ae..31a311f 100644 --- a/src/app/dashboard/settings/page.tsx +++ b/src/app/dashboard/settings/page.tsx @@ -203,11 +203,11 @@ function SettingsPageContent() { const copyShareLink = () => { if (!settings) return; - const link = `${window.location.origin}/u/${settings.github_login}`; - navigator.clipboard.writeText(link); - setCopied(true); - setTimeout(() => setCopied(false), 2000); + navigator.clipboard.writeText(link).then(() => { + setCopied(true); + setTimeout(() => setCopied(false), 2000); + }).catch(() => { }); }; const handleRemoveAccount = async (githubId: string) => { @@ -343,7 +343,9 @@ function SettingsPageContent() { className="flex-1 rounded-lg border border-[var(--border)] bg-[var(--control)] px-4 py-2 text-sm text-[var(--card-foreground)] focus:outline-none" />