1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 18:00:18 +01:00

Fix #17848 - Ensure NFT collections toggle appropriately (#17972)

This commit is contained in:
David Walsh 2023-03-09 12:10:37 -06:00 committed by GitHub
parent 766c8a3e53
commit 423e0854d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 }) => {