@@ -62,29 +62,28 @@ export const useGroupProjectsByPaymentStatus = (
6262
6363 const allProjects : MatchingStatsData [ ] = useMemo (
6464 ( ) =>
65- round . matchingDistribution ?. matchingDistribution . map (
66- ( matchingStatsData ) => {
67- return {
68- projectName : matchingStatsData . projectName ,
69- contributionsCount : matchingStatsData . contributionsCount ,
70- matchPoolPercentage : matchingStatsData . matchPoolPercentage ,
71- projectId : matchingStatsData . projectId ,
72- applicationId : matchingStatsData . applicationId ,
73- anchorAddress : applications ?. find (
74- ( application ) =>
75- application . projectId === matchingStatsData . projectId
76- ) ?. anchorAddress ,
77- matchAmountInToken : BigNumber . from (
78- matchingStatsData . matchAmountInToken
79- ) ,
80- originalMatchAmountInToken : BigNumber . from (
81- matchingStatsData . originalMatchAmountInToken
82- ) ,
83- projectPayoutAddress : matchingStatsData . projectPayoutAddress ,
84- } ;
85- }
86- ) ?? [ ] ,
87- [ round . matchingDistribution ?. matchingDistribution , applications ]
65+ round . matchingDistribution ?. map ( ( matchingStatsData ) => {
66+ const anchorAddress = applications ?. find (
67+ ( application ) => application . projectId === matchingStatsData . projectId
68+ ) ?. anchorAddress ;
69+
70+ return {
71+ projectName : matchingStatsData . projectName ,
72+ contributionsCount : matchingStatsData . contributionsCount ,
73+ matchPoolPercentage : matchingStatsData . matchPoolPercentage ,
74+ projectId : matchingStatsData . projectId ,
75+ applicationId : matchingStatsData . applicationId ,
76+ anchorAddress,
77+ matchAmountInToken : BigNumber . from (
78+ matchingStatsData . matchAmountInToken
79+ ) ,
80+ originalMatchAmountInToken : BigNumber . from (
81+ matchingStatsData . originalMatchAmountInToken
82+ ) ,
83+ projectPayoutAddress : matchingStatsData . projectPayoutAddress ,
84+ } ;
85+ } ) ?? [ ] ,
86+ [ round . matchingDistribution , applications ]
8887 ) ;
8988
9089 useEffect ( ( ) => {
@@ -103,11 +102,13 @@ export const useGroupProjectsByPaymentStatus = (
103102 let tmpProject = project ;
104103
105104 if ( projectStatus === "paid" ) {
105+ const hash = paidProjects ?. find (
106+ ( p ) => p . projectId === project . projectId
107+ ) ?. distributionTransaction ;
108+
106109 tmpProject = {
107110 ...project ,
108- hash :
109- paidProjects ?. find ( ( p ) => p . projectId === project . projectId )
110- ?. distributionTransaction || undefined ,
111+ hash : hash || undefined ,
111112 status : "" ,
112113 } ;
113114 }
@@ -118,7 +119,7 @@ export const useGroupProjectsByPaymentStatus = (
118119 }
119120
120121 fetchData ( ) ;
121- // eslint-disable-next-line react-hooks/exhaustive-deps
122- } , [ allProjects ] ) ;
122+ } , [ allProjects , paidProjects , paidProjectIds ] ) ;
123+
123124 return groupedProjects ;
124125} ;
0 commit comments