Skip to content

Commit

Permalink
fix: Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ChefMomota committed Jul 6, 2023
1 parent 7b72520 commit 27aa87a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/web/src/views/TradingReward/hooks/useRankList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export const useRankList = ({ campaignId, currentPage }: UseRankListProps): Rank
const response = await fetch(
`${TRADING_REWARD_API}/rank_list/campaignId/${campaignId}/type/${RewardType.TOP_TRADERS}/page/${currentPage}/size/${MAX_PER_PAGE}`,
)
console.log('response', response.url)
const result: RankListResponse = await response.json()

const topThree = result.data.topTradersArr.filter((arr) => arr.rank > 0 && arr.rank <= 3)
Expand All @@ -73,6 +74,11 @@ export const useRankList = ({ campaignId, currentPage }: UseRankListProps): Rank
setIsLoading(false)
}
},
{
revalidateOnFocus: false,
revalidateOnReconnect: false,
revalidateOnMount: true,
},
)

return {
Expand Down
3 changes: 3 additions & 0 deletions apps/web/src/views/TradingReward/hooks/useUserTradeRank.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ export const useUserTradeRank = ({ campaignId }: { campaignId: string }) => {
}
},
{
revalidateOnFocus: false,
revalidateOnReconnect: false,
revalidateOnMount: true,
fallbackData: initialState,
},
)
Expand Down

0 comments on commit 27aa87a

Please sign in to comment.