Skip to content

Commit 1b2a0dd

Browse files
committed
fixed some issue of building
1 parent 063d99c commit 1b2a0dd

File tree

4 files changed

+27
-5
lines changed

4 files changed

+27
-5
lines changed

templates/chain-admin/components/asset-list/AssetListSection.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ export const AssetListSection = ({ chainName }: AssetListSectionProps) => {
4747
<AssetsOverview
4848
isLoading={isLoading || !data}
4949
assets={data?.assets ?? []}
50-
prices={data?.prices ?? {}}
50+
prices={Object.fromEntries(
51+
Object.entries(data?.prices ?? {}).filter(
52+
([, value]) => value != null
53+
)
54+
)}
5155
selectedChainName={chainName}
5256
refetch={refetch}
5357
/>

templates/chain-admin/components/asset-list/AssetsOverview.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,11 @@ const AssetsOverview = ({
162162

163163
{data && dropdownTransferInfo && (
164164
<DropdownTransferModal
165-
prices={data?.prices ?? {}}
165+
prices={Object.fromEntries(
166+
Object.entries(data?.prices ?? {}).filter(
167+
([, value]) => value != null
168+
)
169+
)}
166170
assets={ibcAssets}
167171
transferInfoState={{
168172
transferInfo: dropdownTransferInfo,
@@ -176,7 +180,11 @@ const AssetsOverview = ({
176180

177181
{rowTransferInfo && (
178182
<RowTransferModal
179-
prices={data?.prices ?? {}}
183+
prices={Object.fromEntries(
184+
Object.entries(data?.prices ?? {}).filter(
185+
([, value]) => value != null
186+
)
187+
)}
180188
transferInfo={rowTransferInfo}
181189
updateData={refetch}
182190
modalControl={rowModalControl}

templates/chain-admin/hooks/asset-list/useAssets.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ export const useAssets = (chainName: string) => {
7373
Object.entries(dataQueries).map(([key, query]) => [key, query.data])
7474
) as QueriesData;
7575

76-
const { allBalances, prices } = queriesData;
76+
const { allBalances, prices: rawPrices } = queriesData;
77+
78+
// Filter out undefined values to ensure proper indexing
79+
const prices = Object.fromEntries(
80+
Object.entries(rawPrices ?? {}).filter(([, value]) => value != null)
81+
);
7782

7883
const nativeAndIbcBalances: Coin[] = allBalances?.filter(
7984
({ denom }) => !denom.startsWith('gamm') && prices[denom]

templates/chain-admin/hooks/asset-list/useTotalAssets.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,12 @@ export const useTotalAssets = (chainName: string) => {
9090
Object.entries(dataQueries).map(([key, query]) => [key, query.data])
9191
) as QueriesData;
9292

93-
const { allBalances, delegations, prices = {} } = queriesData;
93+
const { allBalances, delegations, prices: rawPrices = {} } = queriesData;
94+
95+
// Filter out undefined values to ensure proper indexing
96+
const prices = Object.fromEntries(
97+
Object.entries(rawPrices).filter(([, value]) => value != null)
98+
);
9499

95100
const stakedTotal = delegations
96101
?.map((coin) => calcCoinDollarValue(prices, coin))

0 commit comments

Comments
 (0)