catch paste errors

This commit is contained in:
Paul Miller
2023-06-16 16:29:20 -05:00
committed by Tony Giorgio
parent 97d9d9969e
commit 81d45874fd
3 changed files with 15 additions and 14 deletions

View File

@@ -10,7 +10,7 @@ export const useCopy = ({ copiedTimeout = 2000 }: UseCopyProps = {}): [
copied: Accessor<boolean>
] => {
const [copied, setCopied] = createSignal(false);
let timeout: NodeJS.Timeout;
let timeout: number;
const copy: CopyFn = async (text) => {
await navigator.clipboard.writeText(text);
setCopied(true);