Skip to content

Commit

Permalink
updated the previously owned state for nft (#1082)
Browse files Browse the repository at this point in the history
Fixes
[17206](MetaMask/metamask-extension#17206)

Ideally, when a user previously owned an NFT, and then received the same
one back, we'd put that NFT back into its own group. With the current
implementation, the NFT is always stuck in the Previously Owned
category, even when imported again. This PR is to update the Nft
Controllers to add the NFT back to its own group if we are re-importing
it.
  • Loading branch information
NidhiKJha authored and MajorLift committed Oct 11, 2023
1 parent aa51fdb commit e707a6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/assets-controllers/src/NftController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ export class NftController extends BaseController<NftConfig, NftState> {
nftMetadata,
existingEntry,
);
if (differentMetadata) {
if (differentMetadata || !existingEntry.isCurrentlyOwned) {
// TODO: Switch to indexToUpdate
const indexToRemove = nfts.findIndex(
(nft) =>
Expand Down

0 comments on commit e707a6d

Please sign in to comment.