From d6f5f05a703137f6fdc44d3efcd7ea734edc3a4e Mon Sep 17 00:00:00 2001 From: corlard3y Date: Mon, 25 Nov 2024 10:40:39 +0100 Subject: [PATCH] update stake code --- src/modules/rewards/components/StakePushSection.tsx | 7 +++++-- src/modules/rewards/hooks/useStakeRewardsResetTime.tsx | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/modules/rewards/components/StakePushSection.tsx b/src/modules/rewards/components/StakePushSection.tsx index 10cae3ed15..f3e6062b4e 100644 --- a/src/modules/rewards/components/StakePushSection.tsx +++ b/src/modules/rewards/components/StakePushSection.tsx @@ -25,7 +25,7 @@ export type StakePushPoints = { const StakePushSection: FC = ({ title, subtitle, timeline, lifeTime }) => { const { account, isWalletConnected } = useAccount(); const { isLocked } = useRewardsContext(); - const { stakePushArray, uniV2PushArray, isLoading, daysToReset } = useStakeRewardsResetTime({ + const { stakePushArray, uniV2PushArray, isLoading, daysToReset, refetchSendActivities } = useStakeRewardsResetTime({ lifeTime, }); const [errorMessage, setErrorMessage] = useState(''); @@ -184,7 +184,10 @@ const StakePushSection: FC = ({ title, subtitle, timeline, life hasEpochEnded={hasEpochEnded} allUsersActivity={allUsersActivity as StakeActivityResponse} isAllActivitiesLoading={isAllActivitiesLoading} - refetchActivity={refetchActivity} + refetchActivity={() => { + refetchActivity(); + refetchSendActivities(); + }} lifeTime={lifeTime} /> ))} diff --git a/src/modules/rewards/hooks/useStakeRewardsResetTime.tsx b/src/modules/rewards/hooks/useStakeRewardsResetTime.tsx index c61813fdfd..6e789562b2 100644 --- a/src/modules/rewards/hooks/useStakeRewardsResetTime.tsx +++ b/src/modules/rewards/hooks/useStakeRewardsResetTime.tsx @@ -65,7 +65,7 @@ const useStakeRewardsResetTime = ({ lifeTime }: StakeRewardsResetTime) => { const activityTitles = allPushArray?.map((activity) => activity.activityType); - const { data: sendRecentActivities } = useGetRewardActivityStatus( + const { data: sendRecentActivities, refetch: refetchSendActivities } = useGetRewardActivityStatus( { userId: userDetails?.userId as string, activities: activityTitles as string[], @@ -154,7 +154,7 @@ const useStakeRewardsResetTime = ({ lifeTime }: StakeRewardsResetTime) => { } }, [userDetails?.userId, isWalletConnected, isLoadingPushStakeData, isLoadingPushUniData, sendRecentActivities]); - return { stakePushArray, uniV2PushArray, isLoading, daysToReset }; + return { stakePushArray, uniV2PushArray, isLoading, daysToReset, refetchSendActivities }; }; export { useStakeRewardsResetTime };