diff --git a/ui/components/multichain/network-list-menu/network-list-menu.test.js b/ui/components/multichain/network-list-menu/network-list-menu.test.js index 93a55538a4ab..ec4539aa55da 100644 --- a/ui/components/multichain/network-list-menu/network-list-menu.test.js +++ b/ui/components/multichain/network-list-menu/network-list-menu.test.js @@ -22,6 +22,7 @@ const mockSetActiveNetwork = jest.fn(); const mockUpdateCustomNonce = jest.fn(); const mockSetNextNonce = jest.fn(); const mockSetTokenNetworkFilter = jest.fn(); +const mockDetectNfts = jest.fn(); jest.mock('../../../store/actions.ts', () => ({ setShowTestNetworks: () => mockSetShowTestNetworks, @@ -32,6 +33,7 @@ jest.mock('../../../store/actions.ts', () => ({ setNetworkClientIdForDomain: (network, id) => mockSetNetworkClientIdForDomain(network, id), setTokenNetworkFilter: () => mockSetTokenNetworkFilter, + detectNfts: () => mockDetectNfts, })); const MOCK_ORIGIN = 'https://portfolio.metamask.io'; @@ -218,6 +220,7 @@ describe('NetworkListMenu', () => { expect(mockSetActiveNetwork).toHaveBeenCalled(); expect(mockUpdateCustomNonce).toHaveBeenCalled(); expect(mockSetNextNonce).toHaveBeenCalled(); + expect(mockDetectNfts).toHaveBeenCalled(); }); it('shows the correct selected network when networks share the same chain ID', () => { diff --git a/ui/components/multichain/network-list-menu/network-list-menu.tsx b/ui/components/multichain/network-list-menu/network-list-menu.tsx index 8b18170adc6c..a5f5f16896d6 100644 --- a/ui/components/multichain/network-list-menu/network-list-menu.tsx +++ b/ui/components/multichain/network-list-menu/network-list-menu.tsx @@ -29,6 +29,7 @@ import { updateCustomNonce, setNextNonce, setTokenNetworkFilter, + detectNfts, } from '../../../store/actions'; import { CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP, @@ -287,6 +288,7 @@ export const NetworkListMenu = ({ onClose }: { onClose: () => void }) => { dispatch(toggleNetworkMenu()); dispatch(updateCustomNonce('')); dispatch(setNextNonce('')); + dispatch(detectNfts()); // as a user, I don't want my network selection to force update my filter when I have "All Networks" toggled on // however, if I am already filtered on "Current Network", we'll want to filter by the selected network when the network changes