Skip to content

Commit

Permalink
crash fix (#6025)
Browse files Browse the repository at this point in the history
* fix

* rename
  • Loading branch information
benisgold authored and brunobar79 committed Aug 21, 2024
1 parent aa5bb0a commit 8fa5c70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/hooks/useWalletBalances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const useWalletBalances = (wallets: AllRainbowWallets): WalletBalanceResult => {

for (const address of allAddresses) {
const lowerCaseAddress = address.toLowerCase() as Address;
const assetBalance = summaryData?.data?.addresses?.[lowerCaseAddress]?.summary?.asset_value.toString() || '0';
const assetBalance = summaryData?.data?.addresses?.[lowerCaseAddress]?.summary?.asset_value?.toString() || '0';

const positionData = queryClient.getQueryData<RainbowPositions | undefined>(positionsQueryKey({ address, currency: nativeCurrency }));
const positionsBalance = positionData?.totals?.total?.amount || '0';
Expand Down
8 changes: 4 additions & 4 deletions src/resources/summary/summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const addysHttp = new RainbowFetchClient({
},
});

export interface AddySummary {
interface AddysSummary {
data: {
addresses: {
[key: Address]: {
Expand All @@ -26,7 +26,7 @@ export interface AddySummary {
};
num_erc20s: number;
last_activity: number;
asset_value: number;
asset_value: number | null;
};
};
summary_by_chain: {
Expand All @@ -38,7 +38,7 @@ export interface AddySummary {
};
num_erc20s: number;
last_activity: number;
asset_value: number;
asset_value: number | null;
};
};
};
Expand Down Expand Up @@ -72,7 +72,7 @@ async function addysSummaryQueryFunction({ queryKey: [{ addresses, currency }] }
addresses,
})
);
return data as AddySummary;
return data as AddysSummary;
}

type AddysSumaryResult = QueryFunctionResult<typeof addysSummaryQueryFunction>;
Expand Down

0 comments on commit 8fa5c70

Please sign in to comment.