diff --git a/packages/shared/lib/core/profile/actions/active-profile/login.ts b/packages/shared/lib/core/profile/actions/active-profile/login.ts index 2bb95a39c51..9ff704f02bb 100644 --- a/packages/shared/lib/core/profile/actions/active-profile/login.ts +++ b/packages/shared/lib/core/profile/actions/active-profile/login.ts @@ -14,6 +14,8 @@ import { isStrongholdUnlocked, refreshWalletAssetsForActiveProfile, setSelectedWallet, + setStrongholdPasswordClearInterval, + startBackgroundSync, } from '@core/wallet/actions' import { get } from 'svelte/store' import { CHECK_PREVIOUS_WALLETS_ARE_DESTROYED_TIMEOUT } from '../../constants' @@ -34,7 +36,7 @@ import { logout } from './logout' import { subscribeToWalletApiEventsForActiveProfile } from './subscribeToWalletApiEventsForActiveProfile' import { checkAndUpdateActiveProfileNetwork } from './checkAndUpdateActiveProfileNetwork' import { checkAndRemoveProfilePicture } from './checkAndRemoveProfilePicture' -import { setStrongholdPasswordClearInterval, startBackgroundSync } from '@core/wallet/actions' +import { DEFAULT_SYNC_OPTIONS } from '@core/wallet/constants' export async function login(loginOptions?: ILoginOptions): Promise { const loginRouter = get(routerManager).getRouterForAppContext(AppContext.Login) @@ -94,11 +96,7 @@ export async function login(loginOptions?: ILoginOptions): Promise { incrementLoginProgress() subscribeToWalletApiEventsForActiveProfile() - await startBackgroundSync({ - syncIncomingTransactions: true, - syncImplicitAccounts: true, - account: { nftOutputs: true }, - }) + await startBackgroundSync(DEFAULT_SYNC_OPTIONS) // Step 8: finish login incrementLoginProgress() diff --git a/packages/shared/lib/core/wallet/actions/events-handlers/handleNewOutputEvent.ts b/packages/shared/lib/core/wallet/actions/events-handlers/handleNewOutputEvent.ts index 1ca81af3028..0e2d230f58c 100644 --- a/packages/shared/lib/core/wallet/actions/events-handlers/handleNewOutputEvent.ts +++ b/packages/shared/lib/core/wallet/actions/events-handlers/handleNewOutputEvent.ts @@ -17,7 +17,6 @@ import { preprocessGroupedOutputs, syncBalance, validateWalletApiEvent, - DEFAULT_SYNC_OPTIONS, } from '@core/wallet' import { AccountAddress, @@ -47,20 +46,10 @@ export async function handleNewOutputEventInternal(walletId: string, payload: Ne const output = outputData.output const isNftOutput = output.type === OutputType.Nft - let _isDelegationOutput = isDelegationOutput(outputData) + const _isDelegationOutput = isDelegationOutput(outputData) const address = outputData.address ? AddressConverter.addressToBech32(outputData.address) : undefined - // TODO: Improve this logic when the delegation output is received -> https://github.com/iotaledger/firefly/issues/8187 - if (wallet?.hasDelegationTransactionInProgress) { - const prevDelegationOutputs = wallet.walletUnspentOutputs?.filter(isDelegationOutput) || [] - await wallet.sync(DEFAULT_SYNC_OPTIONS) - const postDelegationOutputs = (await wallet.unspentOutputs())?.filter(isDelegationOutput) || [] - if (prevDelegationOutputs.length < postDelegationOutputs.length) { - _isDelegationOutput = true - } - } - // The basic outputs of the faucet dont have an address const isBasicOutput = output.type === OutputType.Basic if ( diff --git a/packages/shared/lib/core/wallet/constants/default-sync-options.constant.ts b/packages/shared/lib/core/wallet/constants/default-sync-options.constant.ts index 91b34de95fd..2a73d2fede6 100644 --- a/packages/shared/lib/core/wallet/constants/default-sync-options.constant.ts +++ b/packages/shared/lib/core/wallet/constants/default-sync-options.constant.ts @@ -20,4 +20,5 @@ export const DEFAULT_SYNC_OPTIONS: SyncOptions = { }, syncIncomingTransactions: true, syncNativeTokenFoundries: true, + syncImplicitAccounts: true, }