Skip to content

Commit

Permalink
TW-913: NFT update. Tokens Manage dropdown. Fix QA. Leading assets
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-tsx committed Jul 27, 2023
1 parent 645a011 commit 592334a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/app/pages/Home/OtherComponents/Tokens/Tokens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ export const TokensTab: FC = () => {
const { filteredAssets, searchValue, setSearchValue } = useFilteredAssetsSlugs(
slugs,
isZeroBalancesHidden,
LEADING_ASSETS,
true
LEADING_ASSETS
);

const isEnabledAdsBanner = useIsEnabledAdsBannerSelector();
Expand Down
3 changes: 1 addition & 2 deletions src/app/templates/SwapForm/SwapFormInput/SwapFormInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ export const SwapFormInput: FC<SwapFormInputProps> = ({
const { filteredAssets, searchValue, setSearchValue, tokenId, setTokenId } = useFilteredAssetsSlugs(
route3tokensSlugs,
name === 'input',
LEADING_ASSETS,
false
LEADING_ASSETS
);

const showTokenIdInput = useSwapFormTokenIdInput(searchValue);
Expand Down
6 changes: 4 additions & 2 deletions src/lib/assets/use-filtered.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function useFilteredAssetsSlugs(
assetsSlugs: string[],
filterZeroBalances = false,
leadingAssets?: string[],
leadingAssetsAreFilterable = true
leadingAssetsAreFilterable = false
) {
const allTokensMetadata = useTokensMetadataWithPresenceCheck(assetsSlugs);

Expand Down Expand Up @@ -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,
Expand All @@ -69,6 +70,7 @@ export function useFilteredAssetsSlugs(
}, [
leadingAssets,
leadingAssetsAreFilterable,
filterZeroBalances,
isNonZeroBalance,
searchedSlugs,
searchValueDebounced,
Expand Down

0 comments on commit 592334a

Please sign in to comment.