From a98c2b4b77751c29823cdf6fe6e5f214bc5faa72 Mon Sep 17 00:00:00 2001 From: yukigesho Date: Thu, 14 Nov 2024 21:56:25 -0800 Subject: [PATCH] fix: open bounties --- src/components/bounty/ClaimItem.tsx | 48 +++++++++-------------------- src/components/bounty/ClaimList.tsx | 2 -- src/trpc/routers/_app.ts | 5 +++ 3 files changed, 20 insertions(+), 35 deletions(-) diff --git a/src/components/bounty/ClaimItem.tsx b/src/components/bounty/ClaimItem.tsx index 5873993..c502004 100644 --- a/src/components/bounty/ClaimItem.tsx +++ b/src/components/bounty/ClaimItem.tsx @@ -23,7 +23,6 @@ export default function ClaimItem({ issuer, bountyId, accepted, - isMultiplayer, url, }: { id: string; @@ -32,7 +31,6 @@ export default function ClaimItem({ issuer: string; bountyId: string; accepted: boolean; - isMultiplayer: boolean; url: string; }) { const account = useAccount(); @@ -189,43 +187,27 @@ export default function ClaimItem({ />
- {isMultiplayer && account.address === issuer && ( - - )} - {bounty.data && bounty.data.inProgress && - !isMultiplayer && account.address === bounty.data.issuer && ( -
{ - if (account.isConnected) { - acceptClaimMutation.mutate({ - bountyId: BigInt(bountyId), - claimId: BigInt(id), - }); - } else { - toast.error('Please connect wallet to continue'); - } + bounty.data.participants.length > 1 + ? submitForVoteMutation.mutate({ + bountyId: BigInt(bountyId), + claimId: BigInt(id), + }) + : acceptClaimMutation.mutate({ + bountyId: BigInt(bountyId), + claimId: BigInt(id), + }); }} - className='acceptButton cursor-pointer mt-5 text-white hover:bg-[#F15E5F] border border-[#F15E5F] rounded-[8px] py-2 px-5' > - accept -
+ {bounty.data.participants.length > 1 + ? 'submit for vote' + : 'accept'} + )}
diff --git a/src/components/bounty/ClaimList.tsx b/src/components/bounty/ClaimList.tsx index 685084a..8dbf81d 100644 --- a/src/components/bounty/ClaimList.tsx +++ b/src/components/bounty/ClaimList.tsx @@ -35,7 +35,6 @@ export default function ClaimList({ {votingClaim && (
(