Skip to content

Commit

Permalink
fix: remove duplicated ownership check (#2393)
Browse files Browse the repository at this point in the history
* filter for network on ownership check

* disable feature flag
  • Loading branch information
MarkNerdi authored Apr 29, 2024
1 parent 0ba5be6 commit a5681bc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/desktop/features/network.features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const networkFeatures: INetworkFeatures = {
},
},
evmNetworks: {
enabled: true,
enabled: false,
},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function fetchL2BalanceForAccount(profileId: string, account: IAccountSta
}

if (features.collectibles.erc721.enabled) {
void updateErc721NftsOwnership(account)
void updateErc721NftsOwnership(account, evmNetwork.id)
}

const l2TokenBalance = isIscChain(evmNetwork)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import { IErc721Nft } from '../interfaces'
import { getAllAccountNfts, persistedNftForActiveProfile, updatePersistedNft } from '../stores'
import { getOwnerOfErc721Nft } from '../utils'
import { get } from 'svelte/store'
import { NetworkId } from '@core/network'

export async function updateErc721NftsOwnership(account: IAccountState): Promise<void> {
export async function updateErc721NftsOwnership(account: IAccountState, networkId: NetworkId): Promise<void> {
try {
const trackedErc721Nfts =
(getAllAccountNfts()[account.index]?.filter((nft) => {
return nft.standard === NftStandard.Erc721
return nft.standard === NftStandard.Erc721 && nft.networkId === networkId
}) as IErc721Nft[]) ?? []
const promises = trackedErc721Nfts.map(async (nft) => {
const updatedOwner = await getOwnerOfErc721Nft(nft)
Expand Down

0 comments on commit a5681bc

Please sign in to comment.