Skip to content

Commit

Permalink
fix prettier error
Browse files Browse the repository at this point in the history
  • Loading branch information
MuhammadUmer44 committed Jan 5, 2025
1 parent 5284825 commit 3dee47b
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions src/store/bountyCard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,31 +86,33 @@ export class BountyCardStore {
const data = (await response.json()) as BountyCard[] | null;

// Fetch proof counts for each bounty
const bountyCardsWithProofs = await Promise.all((data || []).map(async (bounty: BountyCard) => {
try {
const proofsUrl = `${TribesURL}/gobounties/${bounty.id}/proofs`;
const proofsResponse = await fetch(proofsUrl, {
method: 'GET',
headers: {
'x-jwt': jwt,
'Content-Type': 'application/json'
const bountyCardsWithProofs = await Promise.all(
(data || []).map(async (bounty: BountyCard) => {
try {
const proofsUrl = `${TribesURL}/gobounties/${bounty.id}/proofs`;
const proofsResponse = await fetch(proofsUrl, {
method: 'GET',
headers: {
'x-jwt': jwt,
'Content-Type': 'application/json'
}
});

if (!proofsResponse.ok) {
return { ...bounty, pow: 0 };
}
});

if (!proofsResponse.ok) {
const proofs = await proofsResponse.json();
return {
...bounty,
pow: Array.isArray(proofs) ? proofs.length : 0
};
} catch (error) {
console.error(`Error fetching proofs for bounty ${bounty.id}:`, error);
return { ...bounty, pow: 0 };
}

const proofs = await proofsResponse.json();
return {
...bounty,
pow: Array.isArray(proofs) ? proofs.length : 0
};
} catch (error) {
console.error(`Error fetching proofs for bounty ${bounty.id}:`, error);
return { ...bounty, pow: 0 };
}
}));
})
);

runInAction(() => {
if (this.pagination.currentPage === 1) {
Expand Down

0 comments on commit 3dee47b

Please sign in to comment.