mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(codebase audit): preserve cleanup without regressions
Fix codebase audit regressions while preserving UI/UX behavior and adding review-driven hardening.
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
*/
|
||||
export const copyToClipboard = async (text: string): Promise<void> => {
|
||||
// Check if we're in Electron and use its clipboard API
|
||||
if (typeof window !== 'undefined' && (window as any).electronApi?.copyToClipboard) {
|
||||
if (typeof window !== 'undefined' && window.electronApi?.copyToClipboard) {
|
||||
try {
|
||||
const result = await (window as any).electronApi.copyToClipboard(text);
|
||||
const result = await window.electronApi.copyToClipboard(text);
|
||||
if (!result.success) {
|
||||
throw new Error(result.error || 'Failed to copy to clipboard');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user