From a9336ceacc74cc812a96ec968831d2eca4c9c4a9 Mon Sep 17 00:00:00 2001 From: ZackYoung Date: Thu, 28 Nov 2024 17:45:46 +0800 Subject: [PATCH] fix_resource_use_copy_add_jar --- dinky-web/src/utils/function.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dinky-web/src/utils/function.tsx b/dinky-web/src/utils/function.tsx index eaf8014ba7..1106ba0ed8 100644 --- a/dinky-web/src/utils/function.tsx +++ b/dinky-web/src/utils/function.tsx @@ -649,7 +649,7 @@ export const parseDateStringToDate = (dateString: Date) => { */ export async function handleCopyToClipboard(copyText: string) { // Adapting to browsers without the navigator.clipboard.writeText method can be done using the following code - if (!navigator) { + if (!navigator?.clipboard) { const textarea = document.createElement('textarea'); textarea.value = copyText; document.body.appendChild(textarea);