From f32c8760d15bf4713b3f9af1384219a44322febd Mon Sep 17 00:00:00 2001 From: xXJsonDeruloXx Date: Tue, 21 Oct 2025 21:45:14 -0400 Subject: rm old comments --- src/utils/clipboardUtils.ts | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/utils') diff --git a/src/utils/clipboardUtils.ts b/src/utils/clipboardUtils.ts index 2d480fc..8a04caa 100644 --- a/src/utils/clipboardUtils.ts +++ b/src/utils/clipboardUtils.ts @@ -7,7 +7,6 @@ * This is especially important in gaming mode where clipboard APIs may behave differently */ export async function copyToClipboard(text: string): Promise { - // Use the proven input simulation method const tempInput = document.createElement('input'); tempInput.value = text; tempInput.style.position = 'absolute'; @@ -15,18 +14,15 @@ export async function copyToClipboard(text: string): Promise { document.body.appendChild(tempInput); try { - // Focus and select the text tempInput.focus(); tempInput.select(); - // Try copying using execCommand first (most reliable in gaming mode) let copySuccess = false; try { if (document.execCommand('copy')) { copySuccess = true; } } catch (e) { - // If execCommand fails, try navigator.clipboard as fallback try { await navigator.clipboard.writeText(text); copySuccess = true; @@ -37,7 +33,6 @@ export async function copyToClipboard(text: string): Promise { return copySuccess; } finally { - // Clean up document.body.removeChild(tempInput); } } @@ -50,7 +45,6 @@ export async function verifyCopy(expectedText: string): Promise { const readBack = await navigator.clipboard.readText(); return readBack === expectedText; } catch (e) { - // Verification not available, assume success return true; } } -- cgit v1.2.3