From e878c0b76fdaa87f91c8f755b1208b014246fff9 Mon Sep 17 00:00:00 2001 From: yukigesho Date: Sat, 9 Nov 2024 21:47:33 -0800 Subject: [PATCH] feat: fix create claim --- src/components/bounty/ClaimItem.tsx | 1 + src/components/global/FormClaim.tsx | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/components/bounty/ClaimItem.tsx b/src/components/bounty/ClaimItem.tsx index 3f6a958..74a3452 100644 --- a/src/components/bounty/ClaimItem.tsx +++ b/src/components/bounty/ClaimItem.tsx @@ -85,6 +85,7 @@ export default function ClaimItem({ }); if (accepted) { bounty.refetch(); + return; } await new Promise((resolve) => setTimeout(resolve, 1_000)); } diff --git a/src/components/global/FormClaim.tsx b/src/components/global/FormClaim.tsx index 8358b51..9906423 100644 --- a/src/components/global/FormClaim.tsx +++ b/src/components/global/FormClaim.tsx @@ -70,7 +70,6 @@ export default function FormClaim({ 'image/jpeg': ['.jpg', '.jpeg'], 'image/heic': ['.heic'], }, - disabled: !!imageURI, }); const handleImageUpload = async (file: File) => { @@ -134,13 +133,17 @@ export default function FormClaim({ const log = receipt.logs .map((log) => { - return decodeEventLog({ - abi, - data: log.data, - topics: log.topics, - }); + try { + return decodeEventLog({ + abi, + data: log.data, + topics: log.topics, + }); + } catch (e) { + return null; + } }) - .find((log) => log.eventName === 'ClaimCreated'); + .find((log) => log?.eventName === 'ClaimCreated'); if (!log) { throw new Error('No logs found'); @@ -183,7 +186,7 @@ export default function FormClaim({ <>