Skip to content

Commit cf78624

Browse files
committed
fix: Handle edge case where tokeNetworkFilter is undefined, this should not break the app
1 parent 7bfb306 commit cf78624

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ui/components/app/assets/asset-list/asset-list-control-bar/asset-list-control-bar.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ const AssetListControlBar = ({ showTokensLinks }: AssetListControlBarProps) => {
4242
const [isNetworkFilterPopoverOpen, setIsNetworkFilterPopoverOpen] =
4343
useState(false);
4444

45+
const allNetworksFilterShown = Object.keys(tokenNetworkFilter ?? {}).length;
46+
4547
const windowType = getEnvironmentType();
4648
const isFullScreen =
4749
windowType !== ENVIRONMENT_TYPE_NOTIFICATION &&
@@ -94,7 +96,7 @@ const AssetListControlBar = ({ showTokensLinks }: AssetListControlBarProps) => {
9496
marginRight={isFullScreen ? 2 : null}
9597
ellipsis
9698
>
97-
{Object.keys(tokenNetworkFilter)?.length
99+
{allNetworksFilterShown
98100
? currentNetwork?.nickname ?? t('currentNetwork')
99101
: t('allNetworks')}
100102
</ButtonBase>

0 commit comments

Comments
 (0)