Skip to content

Commit

Permalink
feat: fix create claim
Browse files Browse the repository at this point in the history
  • Loading branch information
yukigesho committed Nov 11, 2024
1 parent a42c4cc commit e878c0b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/components/bounty/ClaimItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export default function ClaimItem({
});
if (accepted) {
bounty.refetch();
return;
}
await new Promise((resolve) => setTimeout(resolve, 1_000));
}
Expand Down
19 changes: 11 additions & 8 deletions src/components/global/FormClaim.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export default function FormClaim({
'image/jpeg': ['.jpg', '.jpeg'],
'image/heic': ['.heic'],
},
disabled: !!imageURI,
});

const handleImageUpload = async (file: File) => {
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -183,7 +186,7 @@ export default function FormClaim({
<>
<Loading open={createClaimMutations.isPending} status={status} />
<Dialog
open={open}
open={!createClaimMutations.isPending && open}
onClose={onClose}
maxWidth='xs'
PaperProps={{
Expand Down

0 comments on commit e878c0b

Please sign in to comment.