Skip to content

Commit

Permalink
fix: stx fallback btn show on load
Browse files Browse the repository at this point in the history
  • Loading branch information
alter-eggo committed Jul 22, 2024
1 parent 1187acf commit 95d6ea5
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/app/features/asset-list/asset-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import { RunesAssetList } from '@app/features/asset-list/bitcoin/runes-asset-lis
import { Src20TokenAssetList } from '@app/features/asset-list/bitcoin/src20-token-asset-list/src20-token-asset-list';
import { Stx20TokenAssetList } from '@app/features/asset-list/stacks/stx20-token-asset-list/stx20-token-asset-list';
import { StxCryptoAssetItem } from '@app/features/asset-list/stacks/stx-crypo-asset-item/stx-crypto-asset-item';
import { useCurrentStacksAccount } from '@app/store/accounts/blockchain/stacks/stacks-account.hooks';
import { useHasLedgerKeys } from '@app/store/ledger/ledger.selectors';

import { ConnectLedgerAssetItemFallback } from './_components/connect-ledger-asset-item-fallback';
import { BtcCryptoAssetItem } from './bitcoin/btc-crypto-asset-item/btc-crypto-asset-item';
Expand All @@ -34,6 +36,8 @@ interface AssetListProps {
}
export function AssetList({ onSelectAsset, variant = 'read-only' }: AssetListProps) {
const { whenWallet } = useWalletType();
const currentAccount = useCurrentStacksAccount();
const isLedger = useHasLedgerKeys();

const isReadOnly = variant === 'read-only';

Expand Down Expand Up @@ -65,12 +69,14 @@ export function AssetList({ onSelectAsset, variant = 'read-only' }: AssetListPro

<CurrentStacksAccountLoader
fallback={
<ConnectLedgerAssetItemFallback
chain="stacks"
icon={<StxAvatarIcon />}
symbol="STX"
variant={variant}
/>
!currentAccount && !isLedger ? null : (
<ConnectLedgerAssetItemFallback
chain="stacks"
icon={<StxAvatarIcon />}
symbol="STX"
variant={variant}
/>
)
}
>
{account => (
Expand Down

0 comments on commit 95d6ea5

Please sign in to comment.