From e3e5cacbed9758aa386f0a0fb635c365f577c02a Mon Sep 17 00:00:00 2001 From: nick134 <76399455+nick134-bit@users.noreply.github.com> Date: Wed, 15 May 2024 19:11:30 +0200 Subject: [PATCH] fix: remove error catch --- components/Pages/Dashboard/Dashboard.tsx | 4 ++-- services/useAPI.ts | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/components/Pages/Dashboard/Dashboard.tsx b/components/Pages/Dashboard/Dashboard.tsx index 6a7fef46..939ced96 100644 --- a/components/Pages/Dashboard/Dashboard.tsx +++ b/components/Pages/Dashboard/Dashboard.tsx @@ -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) { diff --git a/services/useAPI.ts b/services/useAPI.ts index d904b76b..7bf47f39 100644 --- a/services/useAPI.ts +++ b/services/useAPI.ts @@ -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) {