From 2c98b811110d8bd2bc631a441d185d0abd70bfad Mon Sep 17 00:00:00 2001 From: Leendert de Borst Date: Fri, 29 Aug 2025 16:51:08 +0200 Subject: [PATCH] Update ClipboardUtility.ts (#1157) --- apps/mobile-app/utils/ClipboardUtility.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/mobile-app/utils/ClipboardUtility.ts b/apps/mobile-app/utils/ClipboardUtility.ts index a2e091f1f..1590534be 100644 --- a/apps/mobile-app/utils/ClipboardUtility.ts +++ b/apps/mobile-app/utils/ClipboardUtility.ts @@ -2,13 +2,12 @@ import NativeVaultManager from '@/specs/NativeVaultManager'; /** * Copy text to clipboard with automatic expiration based on platform capabilities. - * + * * On iOS: Uses native clipboard expiration via UIPasteboard.setItems with expirationDate. * On Android: Uses native method that combines clipboard copy with automatic clearing: - * - For delays ≤10 seconds: Uses Handler (reliable for short delays) - * - For delays >10 seconds: Uses AlarmManager (works even when app is backgrounded) + * - Uses AlarmManager (works even when app is backgrounded) * - Android 13+: Also marks clipboard content as sensitive - * + * * @param text - The text to copy to clipboard * @param expirationSeconds - Number of seconds after which clipboard should be cleared (0 = no expiration) */ @@ -22,9 +21,9 @@ export async function copyToClipboardWithExpiration( /** * Copy text to clipboard without expiration. - * + * * @param text - The text to copy to clipboard */ export async function copyToClipboard(text: string): Promise { await copyToClipboardWithExpiration(text, 0); -} \ No newline at end of file +}