From 592334acd95e6e90d77a171897c25e3f47cbf51f Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 27 Jul 2023 12:05:44 +0300 Subject: [PATCH] TW-913: NFT update. Tokens Manage dropdown. Fix QA. Leading assets --- src/app/pages/Home/OtherComponents/Tokens/Tokens.tsx | 3 +-- src/app/templates/SwapForm/SwapFormInput/SwapFormInput.tsx | 3 +-- src/lib/assets/use-filtered.ts | 6 ++++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/pages/Home/OtherComponents/Tokens/Tokens.tsx b/src/app/pages/Home/OtherComponents/Tokens/Tokens.tsx index 7e3caeced..eae7ad630 100644 --- a/src/app/pages/Home/OtherComponents/Tokens/Tokens.tsx +++ b/src/app/pages/Home/OtherComponents/Tokens/Tokens.tsx @@ -60,8 +60,7 @@ export const TokensTab: FC = () => { const { filteredAssets, searchValue, setSearchValue } = useFilteredAssetsSlugs( slugs, isZeroBalancesHidden, - LEADING_ASSETS, - true + LEADING_ASSETS ); const isEnabledAdsBanner = useIsEnabledAdsBannerSelector(); diff --git a/src/app/templates/SwapForm/SwapFormInput/SwapFormInput.tsx b/src/app/templates/SwapForm/SwapFormInput/SwapFormInput.tsx index d600ab4b8..18a23d9c4 100644 --- a/src/app/templates/SwapForm/SwapFormInput/SwapFormInput.tsx +++ b/src/app/templates/SwapForm/SwapFormInput/SwapFormInput.tsx @@ -53,8 +53,7 @@ export const SwapFormInput: FC = ({ const { filteredAssets, searchValue, setSearchValue, tokenId, setTokenId } = useFilteredAssetsSlugs( route3tokensSlugs, name === 'input', - LEADING_ASSETS, - false + LEADING_ASSETS ); const showTokenIdInput = useSwapFormTokenIdInput(searchValue); diff --git a/src/lib/assets/use-filtered.ts b/src/lib/assets/use-filtered.ts index 42d70ce6d..0a0730112 100644 --- a/src/lib/assets/use-filtered.ts +++ b/src/lib/assets/use-filtered.ts @@ -16,7 +16,7 @@ export function useFilteredAssetsSlugs( assetsSlugs: string[], filterZeroBalances = false, leadingAssets?: string[], - leadingAssetsAreFilterable = true + leadingAssetsAreFilterable = false ) { const allTokensMetadata = useTokensMetadataWithPresenceCheck(assetsSlugs); @@ -56,7 +56,8 @@ export function useFilteredAssetsSlugs( const filteredAssets = useMemo(() => { if (!isDefined(leadingAssets) || !leadingAssets.length) return searchedSlugs; - const filteredLeadingSlugs = leadingAssetsAreFilterable ? leadingAssets.filter(isNonZeroBalance) : leadingAssets; + const filteredLeadingSlugs = + leadingAssetsAreFilterable && filterZeroBalances ? leadingAssets.filter(isNonZeroBalance) : leadingAssets; const searchedLeadingSlugs = searchAssetsWithNoMeta( searchValueDebounced, @@ -69,6 +70,7 @@ export function useFilteredAssetsSlugs( }, [ leadingAssets, leadingAssetsAreFilterable, + filterZeroBalances, isNonZeroBalance, searchedSlugs, searchValueDebounced,