Skip to content

Commit

Permalink
fix: minor refactor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sahar-fehri committed Jul 10, 2024
1 parent 1a91712 commit e84aa93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions packages/assets-controllers/src/NftDetectionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,9 +668,7 @@ export class NftDetectionController extends BaseController<
singleNFT.token = {
...singleNFT.token,
collection: {
...(singleNFT.token.collection
? singleNFT.token.collection
: {}),
...(singleNFT.token.collection ?? {}),
creator: found?.creator,
openseaVerificationStatus: found?.openseaVerificationStatus,
contractDeployedAt: found.contractDeployedAt,
Expand Down
4 changes: 2 additions & 2 deletions packages/assets-controllers/src/assetsUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ export function hasNewCollectionFields(
newNftMetadata: NftMetadata,
nft: Nft,
): boolean {
const keysNewNftMetadata = Object.keys(newNftMetadata.collection || {});
const keysExistingNft = new Set(Object.keys(nft.collection || {}));
const keysNewNftMetadata = Object.keys(newNftMetadata.collection ?? {});
const keysExistingNft = new Set(Object.keys(nft.collection ?? {}));

return keysNewNftMetadata.some((key) => !keysExistingNft.has(key));
}
Expand Down

0 comments on commit e84aa93

Please sign in to comment.