From b7c8c5f15dae2be8a44b5a9a1e405e659b088bac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nandy=20B=C3=A2?= Date: Thu, 28 Nov 2024 11:56:11 +0100 Subject: [PATCH] feat: mask Merit campaign when aprs are not found appear when some campaigns are temporary disabled --- src/hooks/useMeritIncentives.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hooks/useMeritIncentives.ts b/src/hooks/useMeritIncentives.ts index 68e77297d7..8e0dad32e6 100644 --- a/src/hooks/useMeritIncentives.ts +++ b/src/hooks/useMeritIncentives.ts @@ -16,7 +16,7 @@ export enum MeritAction { type MeritIncentives = { totalAPR: number; actionsAPR: { - [key in MeritAction]: number; + [key in MeritAction]: number | null | undefined; }; }; @@ -141,6 +141,10 @@ export const useMeritIncentives = ({ const APR = data.actionsAPR[incentive.action]; + if (!APR) { + return null; + } + return { incentiveAPR: (APR / 100).toString(), rewardTokenAddress: incentive.rewardTokenAddress,