Skip to content

Commit

Permalink
fix: aprs check inside the IncentivesButton component
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinGbz committed Jan 8, 2025
1 parent 296de8d commit 4251320
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/incentives/IncentivesButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const ZkIgniteIncentivesButton = (params: {
export const IncentivesButton = ({ incentives, symbol, displayBlank }: IncentivesButtonProps) => {
const [open, setOpen] = useState(false);

if (!(incentives && incentives.length > 0)) {
if (!(incentives && incentives.filter((i) => i.incentiveAPR !== '0').length > 0)) {
if (displayBlank) {
return <BlankIncentives />;
} else {
Expand Down
9 changes: 6 additions & 3 deletions src/components/incentives/IncentivesCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ interface IncentivesBoxProps {
}

export const hasIncentivesCheck = (incentives: IncentivesBoxProps) => {
const lmIncentivesCheck =
incentives.incentives && incentives.incentives.filter((i) => i.incentiveAPR !== '0').length > 0;
const lmIncentives = IncentivesButton({
symbol: incentives.symbol,
incentives: incentives.incentives,
});

const meritIncentives = MeritIncentivesButton({
symbol: incentives.symbol,
Expand All @@ -52,7 +54,8 @@ export const hasIncentivesCheck = (incentives: IncentivesBoxProps) => {
rewardedAsset: incentives.address,
protocolAction: incentives.protocolAction,
});
if (lmIncentivesCheck || meritIncentives || zkIgniteIncentives) {

if (lmIncentives || meritIncentives || zkIgniteIncentives) {
return true;
} else {
return false;
Expand Down
1 change: 1 addition & 0 deletions src/components/transactions/FlowCommons/TxModalDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ export const DetailsIncentivesLine = ({
market={market}
address={address}
protocolAction={protocolAction}
isInModal={true}
/>
) : (
<Typography variant="secondary14">
Expand Down

0 comments on commit 4251320

Please sign in to comment.