@@ -62,29 +62,28 @@ export const useGroupProjectsByPaymentStatus = (
62
62
63
63
const allProjects : MatchingStatsData [ ] = useMemo (
64
64
( ) =>
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 ]
88
87
) ;
89
88
90
89
useEffect ( ( ) => {
@@ -103,11 +102,13 @@ export const useGroupProjectsByPaymentStatus = (
103
102
let tmpProject = project ;
104
103
105
104
if ( projectStatus === "paid" ) {
105
+ const hash = paidProjects ?. find (
106
+ ( p ) => p . projectId === project . projectId
107
+ ) ?. distributionTransaction ;
108
+
106
109
tmpProject = {
107
110
...project ,
108
- hash :
109
- paidProjects ?. find ( ( p ) => p . projectId === project . projectId )
110
- ?. distributionTransaction || undefined ,
111
+ hash : hash || undefined ,
111
112
status : "" ,
112
113
} ;
113
114
}
@@ -118,7 +119,7 @@ export const useGroupProjectsByPaymentStatus = (
118
119
}
119
120
120
121
fetchData ( ) ;
121
- // eslint-disable-next-line react-hooks/exhaustive-deps
122
- } , [ allProjects ] ) ;
122
+ } , [ allProjects , paidProjects , paidProjectIds ] ) ;
123
+
123
124
return groupedProjects ;
124
125
} ;
0 commit comments