fix: Reduce ineffective triggering of the clipboard
This commit is contained in:
parent
cfd367baf9
commit
25361c847b
3 changed files with 17 additions and 11 deletions
|
|
@ -12,11 +12,11 @@ export function useCopyToClipboard({
|
|||
const [isCopied, setIsCopied] = React.useState<Boolean>(false)
|
||||
|
||||
const copyToClipboard = (value: string) => {
|
||||
if (
|
||||
typeof window === 'undefined' ||
|
||||
!navigator.clipboard ||
|
||||
!navigator.clipboard.writeText
|
||||
) {
|
||||
if (typeof window === 'undefined' || !navigator.clipboard?.writeText) {
|
||||
return
|
||||
}
|
||||
|
||||
if (!value) {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue