summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorxXJsonDeruloXx <danielhimebauch@gmail.com>2025-10-21 21:45:14 -0400
committerxXJsonDeruloXx <danielhimebauch@gmail.com>2025-10-21 21:45:14 -0400
commitf32c8760d15bf4713b3f9af1384219a44322febd (patch)
tree7d6d85cc39f193b92bc2fd63dd63675aa46a32be /src/utils
parent7b5f3cb8b3d17ad125d2f40a58fbba80e863d703 (diff)
downloaddecky-lsfg-vk-f32c8760d15bf4713b3f9af1384219a44322febd.tar.gz
decky-lsfg-vk-f32c8760d15bf4713b3f9af1384219a44322febd.zip
rm old comments
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/clipboardUtils.ts6
1 files changed, 0 insertions, 6 deletions
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<boolean> {
- // 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<boolean> {
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<boolean> {
return copySuccess;
} finally {
- // Clean up
document.body.removeChild(tempInput);
}
}
@@ -50,7 +45,6 @@ export async function verifyCopy(expectedText: string): Promise<boolean> {
const readBack = await navigator.clipboard.readText();
return readBack === expectedText;
} catch (e) {
- // Verification not available, assume success
return true;
}
}