From dce484a974897e694671676f63cc9bc44f24bd28 Mon Sep 17 00:00:00 2001 From: gomes <17035424+gomesalexandre@users.noreply.github.com> Date: Mon, 23 Sep 2024 14:20:45 +0200 Subject: [PATCH] fix: thor narrowing --- src/pages/Markets/Recommended.tsx | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/pages/Markets/Recommended.tsx b/src/pages/Markets/Recommended.tsx index 7721b67741f..dd4362b6037 100644 --- a/src/pages/Markets/Recommended.tsx +++ b/src/pages/Markets/Recommended.tsx @@ -14,6 +14,7 @@ import { Main } from 'components/Layout/Main' import { SEO } from 'components/Layout/Seo' import { isSome } from 'lib/utils' import { opportunitiesApi } from 'state/slices/opportunitiesSlice/opportunitiesApiSlice' +import { thorchainSaversOpportunityIdsResolver } from 'state/slices/opportunitiesSlice/resolvers/thorchainsavers' import { DefiProvider, DefiType } from 'state/slices/opportunitiesSlice/types' import { selectAssetById, selectAssetIds, selectFeatureFlag } from 'state/slices/selectors' import { store, useAppDispatch, useAppSelector } from 'state/store' @@ -182,18 +183,10 @@ const ThorchainAssets: React.FC<{ }> = ({ selectedChainId }) => { const dispatch = useAppDispatch() const { data: thorchainAssetIdsData, isLoading: isThorchainAssetIdsDataLoading } = useQuery({ - ...reactQueries.thornode.poolsData(), + queryKey: ['thorchainAssets'], + queryFn: thorchainSaversOpportunityIdsResolver, staleTime: Infinity, - select: pools => - pools - .map(pool => poolAssetIdToAssetId(pool.asset)) - .filter(thorchainAsset => { - const asset = selectAssetById(store.getState(), thorchainAsset ?? '') - if (!asset) return false - - return true - }) - .filter(isSome), + select: pools => pools.data, }) useEffect(() => {