From 02c79e7c99d38ad3510a5f693df3d3c569753375 Mon Sep 17 00:00:00 2001 From: mystical-prog Date: Mon, 19 Aug 2024 13:05:04 +0530 Subject: [PATCH] display fix --- components/pages/home/questAndCollectionTabs.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/pages/home/questAndCollectionTabs.tsx b/components/pages/home/questAndCollectionTabs.tsx index 04fa7234..7b085164 100644 --- a/components/pages/home/questAndCollectionTabs.tsx +++ b/components/pages/home/questAndCollectionTabs.tsx @@ -113,7 +113,8 @@ const QuestAndCollectionTabs: FunctionComponent< }, [address]); const completedBoostNumber = useMemo( - () => boosts?.filter((b) => completedBoostIds?.includes(b.id)).length, + () => boosts?.filter((b) => completedBoostIds?.includes(b.id) && ((new Date().getTime() - boost.expiry) / MILLISECONDS_PER_WEEK <= 3 && + boost.expiry < Date.now())).length, [boosts, completedBoostIds] ); @@ -223,13 +224,13 @@ const QuestAndCollectionTabs: FunctionComponent< type={TEXT_TYPE.BODY_DEFAULT} className={`${styles.categoryInfosText} text-gray-200 normal-case`} > - {completedBoostNumber === boosts.length ? ( + {completedBoostNumber === displayBoosts.length ? ( All boosts done ) : ( - `${completedBoostNumber}/${boosts.length} Boost${ + `${completedBoostNumber}/${displayBoosts.length} Boost${ boosts.length > 1 ? "s" : "" } done` )}