Skip to content

Commit

Permalink
fix: onError option of useCopyToClipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
liangfung committed Dec 28, 2023
1 parent 40bda04 commit 59c3061
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ee/tabby-ui/lib/hooks/use-copy-to-clipboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ export function useCopyToClipboard({
}

const onCopyError = (error?: any) => {
onError?.(error)
if (typeof onError === 'function') {
onError?.(error)
return
}

toast({
title: 'Failed to copy.',
variant: 'destructive'
Expand Down

0 comments on commit 59c3061

Please sign in to comment.