Skip to content

Commit

Permalink
fix: thor narrowing
Browse files Browse the repository at this point in the history
  • Loading branch information
gomesalexandre committed Sep 23, 2024
1 parent 68b6338 commit dce484a
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/pages/Markets/Recommended.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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(() => {
Expand Down

0 comments on commit dce484a

Please sign in to comment.