File tree Expand file tree Collapse file tree 2 files changed +9
-24
lines changed
src/components/incentives Expand file tree Collapse file tree 2 files changed +9
-24
lines changed Original file line number Diff line number Diff line change @@ -177,21 +177,13 @@ export const MerklIncentivesButton = (params: {
177177 const { data : merklIncentives } = useMerklIncentives ( params ) ;
178178 const { data : merklPointsIncentives } = useMerklPointsIncentives ( params ) ;
179179
180- let incentiveData = null ;
181- let incentiveAPR = 0 ;
180+ const incentiveData = merklIncentives ?. breakdown
181+ ? merklIncentives
182+ : merklPointsIncentives ?. breakdown
183+ ? merklPointsIncentives
184+ : undefined ;
182185
183- if ( merklIncentives ?. breakdown ) {
184- if ( merklIncentives . breakdown . points ) {
185- incentiveData = merklPointsIncentives ;
186- incentiveAPR = merklPointsIncentives ?. incentiveAPR ? + merklPointsIncentives . incentiveAPR : 0 ;
187- } else {
188- incentiveData = merklIncentives ;
189- incentiveAPR = + merklIncentives . incentiveAPR ;
190- }
191- } else if ( merklPointsIncentives ?. breakdown ) {
192- incentiveData = merklPointsIncentives ;
193- incentiveAPR = + merklPointsIncentives . incentiveAPR ;
194- }
186+ const incentiveAPR = incentiveData ?. incentiveAPR ? + incentiveData . incentiveAPR : 0 ;
195187
196188 if ( ! incentiveData ) {
197189 return null ;
Original file line number Diff line number Diff line change @@ -89,16 +89,9 @@ export const IncentivesCard = ({
8989 const selfAPY = ENABLE_SELF_CAMPAIGN ? meritIncentives ?. variants ?. selfAPY ?? 0 : 0 ;
9090 const totalMeritAPY = meritIncentivesAPR + selfAPY ;
9191
92- let merklIncentivesAPR = 0 ;
93- if ( merklIncentives ?. breakdown ) {
94- if ( merklIncentives . breakdown . points ) {
95- merklIncentivesAPR = merklPointsIncentives ?. breakdown ?. merklIncentivesAPR || 0 ;
96- } else {
97- merklIncentivesAPR = merklIncentives . breakdown . merklIncentivesAPR || 0 ;
98- }
99- } else if ( merklPointsIncentives ?. breakdown ) {
100- merklIncentivesAPR = merklPointsIncentives . breakdown . merklIncentivesAPR || 0 ;
101- }
92+ const merklIncentivesAPR = merklPointsIncentives ?. breakdown ?. points
93+ ? merklPointsIncentives . breakdown . merklIncentivesAPR || 0
94+ : merklIncentives ?. breakdown ?. merklIncentivesAPR || 0 ;
10295
10396 const isBorrow = protocolAction === ProtocolAction . borrow ;
10497
You can’t perform that action at this time.
0 commit comments