Skip to content

Commit

Permalink
fix: CR-487 wrong tvl due to linea testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
viet-nv committed Jul 18, 2023
1 parent 8d66f96 commit 0a07d22
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/state/about/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ export function useGlobalData() {
}
const getResultByChainIds = async (chainIds: readonly ChainId[]) => {
// todo namgold: add aggregator API for solana
const elasticChains = chainIds.filter(isEVM).filter(id => !ELASTIC_NOT_SUPPORTED[id])
const elasticChains = chainIds
.filter(id => isEVM(id))
.filter(id => !ELASTIC_NOT_SUPPORTED[id] && id !== ChainId.LINEA_TESTNET)

const elasticPromises = elasticChains.map(chain =>
allKyberswapConfig[chain].elasticClient.query({
Expand All @@ -70,12 +72,14 @@ export function useGlobalData() {
return total + parseFloat(item?.data?.factories?.[0]?.totalValueLockedUSD || '0')
}, 0)

const allChainPromises = chainIds.filter(isEVM).map(chain =>
allKyberswapConfig[chain].classicClient.query({
query: GLOBAL_DATA(),
fetchPolicy: 'cache-first',
}),
)
const allChainPromises = chainIds
.filter(id => isEVM(id) && id !== ChainId.LINEA_TESTNET)
.map(chain =>
allKyberswapConfig[chain].classicClient.query({
query: GLOBAL_DATA(),
fetchPolicy: 'cache-first',
}),
)

const queryResult = (await Promise.all(allChainPromises.map(promises => promises.catch(e => e)))).filter(
res => !(res instanceof Error),
Expand Down

0 comments on commit 0a07d22

Please sign in to comment.