From 576b4d5601f4ee9d242786297390c7717337d733 Mon Sep 17 00:00:00 2001 From: c0mrade Date: Tue, 26 May 2026 13:48:10 +0300 Subject: [PATCH] fix(admin): surface clipboard copy failures instead of swallowing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two admin paths previously had empty catch blocks around copyToClipboard: the user-detail copy helper and AdminLandings handleCopyUrl. The adapter already attempts the legacy execCommand fallback, so reaching the catch means the operation truly failed — staying silent left admins thinking their click worked when it hadn't. Both now fire notify.error so the failure is visible. --- src/pages/AdminLandings.tsx | 4 +++- src/pages/AdminUserDetail.tsx | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/pages/AdminLandings.tsx b/src/pages/AdminLandings.tsx index ffcadee..440a906 100644 --- a/src/pages/AdminLandings.tsx +++ b/src/pages/AdminLandings.tsx @@ -413,7 +413,9 @@ export default function AdminLandings() { await copyToClipboard(url); notify.success(t('admin.landings.urlCopied')); } catch { - // Clipboard write failed silently + // The clipboard adapter already tries the legacy execCommand fallback; + // if we still failed, surface it so the admin doesn't think it worked. + notify.error(t('common.error')); } }; diff --git a/src/pages/AdminUserDetail.tsx b/src/pages/AdminUserDetail.tsx index 94cad7c..226c6e7 100644 --- a/src/pages/AdminUserDetail.tsx +++ b/src/pages/AdminUserDetail.tsx @@ -1261,7 +1261,11 @@ export default function AdminUserDetail() { try { await copyText(text); notify.success(t('admin.users.detail.copied')); - } catch {} + } catch { + // copy adapter already handles fallback + permission errors; surface + // the failure to the user instead of swallowing it silently. + notify.error(t('common.error')); + } }; if (loading) {