diff --git a/ui/components/app/nfts-items/nfts-items.js b/ui/components/app/nfts-items/nfts-items.js index d84616820..e2ce133d7 100644 --- a/ui/components/app/nfts-items/nfts-items.js +++ b/ui/components/app/nfts-items/nfts-items.js @@ -106,17 +106,19 @@ export default function NftsItems({ }; const updateNftDropDownStateKey = (key, isExpanded) => { - const currentAccountNftDropdownState = - nftsDropdownState[selectedAddress][chainId]; - const newCurrentAccountState = { - ...currentAccountNftDropdownState, + ...nftsDropdownState[selectedAddress][chainId], [key]: !isExpanded, }; - nftsDropdownState[selectedAddress][chainId] = newCurrentAccountState; + const newState = { + ...nftsDropdownState, + [selectedAddress]: { + [chainId]: newCurrentAccountState, + }, + }; - dispatch(updateNftDropDownState(nftsDropdownState)); + dispatch(updateNftDropDownState(newState)); }; const renderCollection = ({ nfts, collectionName, collectionImage, key }) => {