Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkNerdi committed Oct 25, 2023
1 parent d6a83be commit 21655e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import { INftBalanceChange } from '../types'
import { NetworkId } from '@core/network'
import { IAccountState } from '@core/account'

export async function calculateAndAddPersistedNftBalanceChange(
export function calculateAndAddPersistedNftBalanceChange(
account: IAccountState,
networkId: NetworkId,
nftId: string,
owned: boolean,
hidden: boolean = false
): Promise<void> {
): void {
const balanceChangesForAsset = getBalanceChanges(account.index, networkId)?.nfts?.[nftId]
const lastBalanceChange = balanceChangesForAsset?.at(-1)

Expand All @@ -29,7 +29,7 @@ export async function calculateAndAddPersistedNftBalanceChange(
}

if (!hidden) {
const activity = await generateNftBalanceChangeActivity(networkId, nftId, newBalanceChange, account)
const activity = generateNftBalanceChangeActivity(networkId, nftId, newBalanceChange, account)
addActivityToAccountActivitiesInAllAccountActivities(account.index, activity)
}
addPersistedNftBalanceChange(account.index, networkId, nftId, newBalanceChange)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,7 @@ export async function sendTransactionFromEvm(
if (getAddressFromAccountForNetwork(account, networkId) !== activity.subject?.address) {
// Currently only support outgoing transactions being added to activities so we can assume outgoing balance change
if (activity.type === ActivityType.Nft) {
await calculateAndAddPersistedNftBalanceChange(
account,
networkId,
activity.nftId,
false,
true
)
calculateAndAddPersistedNftBalanceChange(account, networkId, activity.nftId, false, true)
}
if (activity.tokenTransfer) {
await updateL2BalanceWithoutActivity(
Expand Down

0 comments on commit 21655e7

Please sign in to comment.