mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
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:
@@ -413,7 +413,9 @@ export default function AdminLandings() {
|
|||||||
await copyToClipboard(url);
|
await copyToClipboard(url);
|
||||||
notify.success(t('admin.landings.urlCopied'));
|
notify.success(t('admin.landings.urlCopied'));
|
||||||
} catch {
|
} 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'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1261,7 +1261,11 @@ export default function AdminUserDetail() {
|
|||||||
try {
|
try {
|
||||||
await copyText(text);
|
await copyText(text);
|
||||||
notify.success(t('admin.users.detail.copied'));
|
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) {
|
if (loading) {
|
||||||
|
|||||||
Reference in New Issue
Block a user