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 af08b25b4a3..e159bf58fdd 100644 --- a/packages/shared/lib/core/profile/actions/active-profile/login.ts +++ b/packages/shared/lib/core/profile/actions/active-profile/login.ts @@ -140,7 +140,14 @@ export async function login(loginOptions?: ILoginOptions): Promise { pollLedgerNanoStatus() } - setSelectedAccount(lastUsedAccountIndex ?? get(activeAccounts)?.[0]?.index ?? null) + let initialSelectedAccountindex = get(activeAccounts)?.[0]?.index + if ( + lastUsedAccountIndex && + get(activeAccounts)?.find((_account) => _account.index === lastUsedAccountIndex) + ) { + initialSelectedAccountindex = lastUsedAccountIndex + } + setSelectedAccount(initialSelectedAccountindex) lastActiveAt.set(new Date()) loggedIn.set(true) setTimeout(() => {