From 6c86ec0d01c7104a904415b1c75fd17c34a09f29 Mon Sep 17 00:00:00 2001 From: Kexort Date: Wed, 13 Nov 2024 13:17:55 +0100 Subject: [PATCH] Fix 'already redeemed' message (#114) --- src/pages/ClaimRewardPage/ClaimRevardPage.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/ClaimRewardPage/ClaimRevardPage.tsx b/src/pages/ClaimRewardPage/ClaimRevardPage.tsx index f3bab6b6..1e9cc686 100644 --- a/src/pages/ClaimRewardPage/ClaimRevardPage.tsx +++ b/src/pages/ClaimRewardPage/ClaimRevardPage.tsx @@ -20,6 +20,9 @@ const ClaimRewardPage: React.FC = () => { const code = localStorage.getItem(GIFTCODE_KEY); if (code !== null && inputRef.current) { inputRef.current.value = code; + if (code === "already redeemed") { + localStorage.removeItem(GIFTCODE_KEY); + } } else if (!nonceRequested) { nonceRequested = true; try { @@ -61,7 +64,7 @@ const ClaimRewardPage: React.FC = () => { console.log("error fetching nonce: ", error); } } - }); + }, []); const handleCopyClick = async () => { if (inputRef.current) {