Skip to content

Commit

Permalink
update stake code
Browse files Browse the repository at this point in the history
  • Loading branch information
corlard3y committed Nov 25, 2024
1 parent 6f4a44c commit d6f5f05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/modules/rewards/components/StakePushSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export type StakePushPoints = {
const StakePushSection: FC<StakePushPoints> = ({ 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<string>('');
Expand Down Expand Up @@ -184,7 +184,10 @@ const StakePushSection: FC<StakePushPoints> = ({ title, subtitle, timeline, life
hasEpochEnded={hasEpochEnded}
allUsersActivity={allUsersActivity as StakeActivityResponse}
isAllActivitiesLoading={isAllActivitiesLoading}
refetchActivity={refetchActivity}
refetchActivity={() => {
refetchActivity();
refetchSendActivities();
}}
lifeTime={lifeTime}
/>
))}
Expand Down
4 changes: 2 additions & 2 deletions src/modules/rewards/hooks/useStakeRewardsResetTime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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[],
Expand Down Expand Up @@ -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 };

0 comments on commit d6f5f05

Please sign in to comment.