Skip to content

Commit

Permalink
fixed tokens not loading in inventory
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewlee348 committed Nov 14, 2024
1 parent 6841e33 commit 5f4f14b
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 42 deletions.
56 changes: 28 additions & 28 deletions examples/react/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,34 @@ export const kitConfig: KitConfig = {
projectName: 'Kit Demo',
useMock: isDebugMode
},
isDev: isDebugMode,
displayedAssets: [
// Native token
{
contractAddress: zeroAddress,
chainId: ChainId.ARBITRUM_NOVA
},
// Native token
{
contractAddress: zeroAddress,
chainId: ChainId.ARBITRUM_SEPOLIA
},
// Waas demo NFT
{
contractAddress: '0x0d402c63cae0200f0723b3e6fa0914627a48462e',
chainId: ChainId.ARBITRUM_NOVA
},
// Waas demo NFT
{
contractAddress: '0x0d402c63cae0200f0723b3e6fa0914627a48462e',
chainId: ChainId.ARBITRUM_SEPOLIA
},
// Skyweaver assets
{
contractAddress: '0x631998e91476da5b870d741192fc5cbc55f5a52e',
chainId: ChainId.POLYGON
}
]
isDev: isDebugMode
// displayedAssets: [
// // Native token
// {
// contractAddress: zeroAddress,
// chainId: ChainId.ARBITRUM_NOVA
// },
// // Native token
// {
// contractAddress: zeroAddress,
// chainId: ChainId.ARBITRUM_SEPOLIA
// },
// // Waas demo NFT
// {
// contractAddress: '0x0d402c63cae0200f0723b3e6fa0914627a48462e',
// chainId: ChainId.ARBITRUM_NOVA
// },
// // Waas demo NFT
// {
// contractAddress: '0x0d402c63cae0200f0723b3e6fa0914627a48462e',
// chainId: ChainId.ARBITRUM_SEPOLIA
// },
// // Skyweaver assets
// {
// contractAddress: '0x631998e91476da5b870d741192fc5cbc55f5a52e',
// chainId: ChainId.POLYGON
// }
// ]
}

export const config =
Expand Down
4 changes: 2 additions & 2 deletions packages/wallet/src/hooks/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ export const getBalancesAssetsSummary = async (
}

const summaryBalances: TokenBalance[] = [
...(nativeTokens.length > 0 ? [nativeTokens[0]] : []),
...(erc20HighestValue.length > 0 ? [erc20HighestValue[0]] : []),
...(nativeTokens.length > 0 ? [...nativeTokens] : []),
...(erc20HighestValue.length > 0 ? [...erc20HighestValue] : []),
...(collectibles.length > 0 ? [...collectibles] : [])
]

Expand Down
24 changes: 12 additions & 12 deletions packages/wallet/src/views/Search/SearchWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,20 +135,20 @@ export const SearchWallet = () => {
toLocation={{
location: 'search-view-all',
params: {
defaultTab: 'collections'
defaultTab: 'coins'
}
}}
label={`Collections (${collectionBalancesAmount})`}
label={`Coins (${coinBalancesAmount})`}
/>
{isPending ? (
Array(5)
.fill(null)
.map((_, i) => <Skeleton key={i} width="full" height="8" />)
) : foundCollectionBalances.length === 0 ? (
<Text color="text100">No collections found</Text>
) : foundCoinBalances.length === 0 ? (
<Text color="text100">No coins found</Text>
) : (
foundCollectionBalances.map((indexedItem, index) => {
const balance = collectionBalances[indexedItem.index]
foundCoinBalances.map((indexItem, index) => {
const balance = coinBalances[indexItem.index]
return <BalanceItem key={index} balance={balance} />
})
)}
Expand All @@ -158,20 +158,20 @@ export const SearchWallet = () => {
toLocation={{
location: 'search-view-all',
params: {
defaultTab: 'coins'
defaultTab: 'collections'
}
}}
label={`Coins (${coinBalancesAmount})`}
label={`Collections (${collectionBalancesAmount})`}
/>
{isPending ? (
Array(5)
.fill(null)
.map((_, i) => <Skeleton key={i} width="full" height="8" />)
) : foundCoinBalances.length === 0 ? (
<Text color="text100">No coins found</Text>
) : foundCollectionBalances.length === 0 ? (
<Text color="text100">No collections found</Text>
) : (
foundCoinBalances.map((indexItem, index) => {
const balance = coinBalances[indexItem.index]
foundCollectionBalances.map((indexedItem, index) => {
const balance = collectionBalances[indexedItem.index]
return <BalanceItem key={index} balance={balance} />
})
)}
Expand Down

0 comments on commit 5f4f14b

Please sign in to comment.