Fix linter complaints

* In JsonView.tsx
  - add setCopied to dependencies of handleCopy useCallback
* In useCopy.ts
  - add timeout to useEffect inside useCopy hook
This commit is contained in:
cliffhall 2025-10-10 11:45:18 -04:00
commit 4e90143071
2 changed files with 2 additions and 2 deletions

View file

@ -51,7 +51,7 @@ const JsonView = memo(
variant: "destructive", variant: "destructive",
}); });
} }
}, [toast, normalizedData]); }, [toast, normalizedData, setCopied]);
return ( return (
<div className={clsx("p-4 border rounded relative", className)}> <div className={clsx("p-4 border rounded relative", className)}>

View file

@ -21,7 +21,7 @@ function useCopy({ timeout = 500 }: UseCopyProps = {}) {
clearTimeout(timeoutId); clearTimeout(timeoutId);
} }
}; };
}, [copied]); }, [copied, timeout]);
return { copied, setCopied }; return { copied, setCopied };
} }