From d15fe5d518741ba66b0f575048eb09edd50b1f1e Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Sat, 9 Mar 2024 20:41:33 +0100 Subject: [PATCH] remove redundant useEffect --- src/views/settings/avatar-settings/avatar-settings.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/views/settings/avatar-settings/avatar-settings.tsx b/src/views/settings/avatar-settings/avatar-settings.tsx index 3eeb36b8..1ca9b6fd 100644 --- a/src/views/settings/avatar-settings/avatar-settings.tsx +++ b/src/views/settings/avatar-settings/avatar-settings.tsx @@ -67,11 +67,6 @@ const AvatarSettings = () => { }; const [hasCopied, setHasCopied] = useState(false); - useEffect(() => { - if (hasCopied) { - setTimeout(() => setHasCopied(false), 2000); - } - }, [hasCopied]); const copyMessageToSign = () => { if (!chainTicker) { @@ -89,6 +84,9 @@ const AvatarSettings = () => { setTimestamp(newTimestamp); navigator.clipboard.writeText(messageToSign); setHasCopied(true); + setTimeout(() => { + setHasCopied(false); + }, 2000); }; // how to resolve and verify NFT signatures https://github.com/plebbit/plebbit-js/blob/master/docs/nft.md