From 1ca6a43e0fb65c72f0065f413dec6b310749a19e Mon Sep 17 00:00:00 2001 From: Dean Shub Date: Mon, 5 Oct 2020 13:42:15 +0300 Subject: [PATCH] optional chaining enhancement --- src/client/copyToClipboard.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/copyToClipboard.ts b/src/client/copyToClipboard.ts index c22c359..efad698 100644 --- a/src/client/copyToClipboard.ts +++ b/src/client/copyToClipboard.ts @@ -1,6 +1,6 @@ // NOTE text selection on double click or select export function copySelected(text: string): boolean { - if (window.clipboardData && window.clipboardData.setData) { + if (window.clipboardData?.setData) { window.clipboardData.setData('Text', text); return true; }