fix(admin): surface clipboard copy failures instead of swallowing

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.
This commit is contained in:
c0mrade
2026-05-26 13:48:10 +03:00
parent bc34e65aac
commit 576b4d5601
2 changed files with 8 additions and 2 deletions

View File

@@ -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) {