Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: undefined asset id in send page #1704

Merged
merged 2 commits into from
Feb 22, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/extension-polkagate/src/hooks/useBalances.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2024 @polkadot/extension-polkagate authors & contributors
// Copyright 2019-2025 @polkadot/extension-polkagate authors & contributors
// SPDX-License-Identifier: Apache-2.0

import type React from 'react';
Expand All @@ -14,7 +14,7 @@ import { useBalancesOnAssethub, useBalancesOnMultiAssetChain, useInfo, useNative
export default function useBalances (address: string | undefined, refresh?: boolean, setRefresh?: React.Dispatch<React.SetStateAction<boolean>>, onlyNew = false, assetId?: string | number): BalancesInfo | undefined {
const { account, api, chainName, decimal: currentDecimal, genesisHash: chainGenesisHash, token: currentToken } = useInfo(address);

const isNativeAssetId = String(assetId) === String(NATIVE_TOKEN_ASSET_ID) || String(assetId) === String(NATIVE_TOKEN_ASSET_ID_ON_ASSETHUB);
const isNativeAssetId = String(assetId) === String(NATIVE_TOKEN_ASSET_ID) || String(assetId) === String(NATIVE_TOKEN_ASSET_ID_ON_ASSETHUB) || assetId === 'undefined';
const maybeNonNativeAssetId = isNativeAssetId ? undefined : assetId;

const balances = useNativeAssetBalances(address, refresh, setRefresh, onlyNew);
Expand Down
Loading