diff --git a/packages/desktop/components/popup/popups/EvmTransactionFromDappPopup.svelte b/packages/desktop/components/popup/popups/EvmTransactionFromDappPopup.svelte index 0d5685153e..f5f02abb44 100644 --- a/packages/desktop/components/popup/popups/EvmTransactionFromDappPopup.svelte +++ b/packages/desktop/components/popup/popups/EvmTransactionFromDappPopup.svelte @@ -4,7 +4,7 @@ import { IConnectedDapp } from '@auxiliary/wallet-connect/interface' import { CallbackParameters } from '@auxiliary/wallet-connect/types' import { sendAndPersistTransactionFromEvm, signEvmTransaction } from '@core/wallet/actions' - import { selectedAccount } from '@core/account/stores' + import { getSelectedAccount, selectedAccount } from '@core/account/stores' import { ExplorerEndpoint, IChain, getDefaultExplorerUrl } from '@core/network' import { DappInfo, TransactionAssetSection } from '@ui' import PopupTemplate from '../PopupTemplate.svelte' @@ -31,7 +31,8 @@ import { LedgerAppName } from '@core/ledger' import { DappVerification, RpcMethod } from '@auxiliary/wallet-connect/enums' import { LegacyTransaction } from '@ethereumjs/tx' - import { activeProfileId } from '@core/profile/stores' + import { getActiveProfileId } from '@core/profile/stores' + import { IAccountState } from '@core/account' export let preparedTransaction: EvmTransactionData export let chain: IChain @@ -87,27 +88,30 @@ } } - async function getSignedTransaction(): Promise { + async function getSignedTransaction(account: IAccountState): Promise { if (preparedTransaction?.v && preparedTransaction?.s && preparedTransaction?.r) { const transaction = LegacyTransaction.fromTxData(preparedTransaction) return getHexEncodedTransaction(transaction) } else { - return await signEvmTransaction(preparedTransaction, chain, $selectedAccount) + return await signEvmTransaction(preparedTransaction, chain, account) } } async function signOrSend(): Promise { - const signedTransaction = await getSignedTransaction() + const profileId = getActiveProfileId() + const account = getSelectedAccount() + const signedTransaction = await getSignedTransaction(account) if (method === RpcMethod.EthSignTransaction) { callback({ result: signedTransaction }) return } + const transactionHash = await sendAndPersistTransactionFromEvm( preparedTransaction, signedTransaction, chain, - $selectedAccount, - $activeProfileId + profileId, + account ) callback({ result: transactionHash }) } diff --git a/packages/desktop/components/popup/popups/SyncAccountsPopup.svelte b/packages/desktop/components/popup/popups/SyncAccountsPopup.svelte index c06f02376c..d2b3dc892d 100644 --- a/packages/desktop/components/popup/popups/SyncAccountsPopup.svelte +++ b/packages/desktop/components/popup/popups/SyncAccountsPopup.svelte @@ -9,7 +9,7 @@ import { DEFAULT_ACCOUNT_RECOVERY_CONFIGURATION } from '@core/profile' import { RecoverAccountsPayload, recoverAccounts } from '@core/profile-manager' import { checkActiveProfileAuth, getBaseToken, loadAccounts } from '@core/profile/actions' - import { activeAccounts, activeProfile, activeProfileId, visibleActiveAccounts } from '@core/profile/stores' + import { activeAccounts, activeProfile, getActiveProfileId, visibleActiveAccounts } from '@core/profile/stores' import { formatTokenAmountBestMatch } from '@core/token' import { refreshAccountTokensForActiveProfile } from '@core/token/actions' import { closePopup } from '@desktop/auxiliary/popup' @@ -140,8 +140,9 @@ onDestroy(async () => { if (hasUsedWalletFinder) { + const profileId = getActiveProfileId() await refreshAccountTokensForActiveProfile() - await generateAndStoreActivitiesForAllAccounts($activeProfileId) + await generateAndStoreActivitiesForAllAccounts(profileId) loadNftsForActiveProfile() } }) diff --git a/packages/desktop/views/dashboard/drawers/dapp-config/views/ConnectedDappsDrawer.svelte b/packages/desktop/views/dashboard/drawers/dapp-config/views/ConnectedDappsDrawer.svelte index 88d937b906..5db0622e91 100644 --- a/packages/desktop/views/dashboard/drawers/dapp-config/views/ConnectedDappsDrawer.svelte +++ b/packages/desktop/views/dashboard/drawers/dapp-config/views/ConnectedDappsDrawer.svelte @@ -27,7 +27,7 @@ let selectedIndex = 0 $: connectedDappsForProfile = $connectedDapps.filter( - (dapp) => !!$persistedDappNamespaces[$activeProfileId]?.[dapp.metadata?.url] + (dapp) => !!$persistedDappNamespaces[$activeProfileId as string]?.[dapp.metadata?.url ?? ''] ) $: displayedDapps = connectedDappsForProfile.filter( (dapp) => (selectedIndex === 0 && !!dapp.session) || (selectedIndex === 1 && !dapp.session) diff --git a/packages/desktop/views/dashboard/send-flow/views/TransactionSummaryView.svelte b/packages/desktop/views/dashboard/send-flow/views/TransactionSummaryView.svelte index 3bca53e586..39e632f437 100644 --- a/packages/desktop/views/dashboard/send-flow/views/TransactionSummaryView.svelte +++ b/packages/desktop/views/dashboard/send-flow/views/TransactionSummaryView.svelte @@ -1,7 +1,7 @@