mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
fix: add missing clearTimeout cleanup in CopyButton useEffect
Closes #934
This commit is contained in:
parent
8232893fbb
commit
89fff1f81f
1 changed files with 3 additions and 1 deletions
|
|
@ -143,9 +143,11 @@ function CopyButton({
|
|||
const [hasCopied, setHasCopied] = React.useState(false);
|
||||
|
||||
React.useEffect(() => {
|
||||
setTimeout(() => {
|
||||
if (!hasCopied) return;
|
||||
const timer = setTimeout(() => {
|
||||
setHasCopied(false);
|
||||
}, 2000);
|
||||
return () => clearTimeout(timer);
|
||||
}, [hasCopied]);
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue