Skip to content

Commit

Permalink
fix: handle empty/undefined props
Browse files Browse the repository at this point in the history
  • Loading branch information
micaelae committed Dec 9, 2024
1 parent 3dbb176 commit 49df7cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type AssetListProps = {
) => boolean;
network?: NetworkConfiguration | AddNetworkFields;
isTokenListLoading?: boolean;
assetItemProps: Pick<
assetItemProps?: Pick<
React.ComponentProps<typeof TokenListItem>,
'isTitleNetworkName' | 'isTitleHidden'
>;
Expand All @@ -56,7 +56,7 @@ export default function AssetList({
isTokenDisabled,
network,
isTokenListLoading = false,
assetItemProps,
assetItemProps = {},
}: AssetListProps) {
const t = useI18nContext();
const selectedTokenAddress = asset?.address;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export function AssetPickerModal({
const allNetworks = useSelector(getNetworkConfigurationsByChainId);
const selectedNetwork =
network ?? (currentChainId && allNetworks[currentChainId]);
const allNetworksToUse = networks ?? Object.values(allNetworks);
const allNetworksToUse = networks ?? Object.values(allNetworks ?? {});
// This indicates whether tokens in the wallet's active network are displayed
const isSelectedNetworkActive = selectedNetwork.chainId === currentChainId;

Expand Down

0 comments on commit 49df7cb

Please sign in to comment.