Skip to content

Commit

Permalink
fix: remove error catch
Browse files Browse the repository at this point in the history
  • Loading branch information
nick134-bit committed May 15, 2024
1 parent fd3c297 commit e3e5cac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions components/Pages/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export const Dashboard: FC = () => {
const mappedDashboardData = []
dashboardData.dashboardData?.map((data) => {

const apr = (dashboardData?.bondingInfos?.[data.chainName]?.bondingAPR) || 0;
const buyback = (dashboardData?.bondingInfos?.[data.chainName]?.buyback) || 0;
const apr = (dashboardData?.bondingInfos?.[data.chainName]?.bondingAPR);
const buyback = (dashboardData?.bondingInfos?.[data.chainName]?.buyback);

const chain = chains?.find((chain) => WALLET_CHAIN_NAMES_BY_CHAIN_ID[chain.chainId] === data.chainName)
if (!chain) {
Expand Down
8 changes: 2 additions & 6 deletions services/useAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,10 @@ export const getPairAprAndDailyVolumeAPI = async (chain_name: string) => {
}

export const getBondingAPRsAPI = async () => {
try {
const response = await fetchWithTimeout(`${await getFastestAPI()}/apex/bonding/aprs`, 50000)
const json = await response.json()
return json?.data || null
} catch (error) {
console.error(error)
return null
}
return json?.data

}

export async function fetchWithTimeout(url: string, timoutMS = 10000) {
Expand Down

0 comments on commit e3e5cac

Please sign in to comment.