Skip to content

Commit

Permalink
fix: hardware wallet now checks for connection before trying to unlock
Browse files Browse the repository at this point in the history
  • Loading branch information
VanessaPC committed Mar 28, 2024
1 parent e8a9096 commit 2011d25
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -2,6 +2,7 @@
import React, { useCallback, useMemo } from 'react';
import { useTranslation, Trans } from 'react-i18next';
import { NavigationButton, PostHogAction, toast } from '@lace/common';
import { Wallet } from '@lace/cardano';
import styles from './WalletAccounts.module.scss';
import { ProfileDropdown } from '@lace/ui';
import { AccountData } from '@lace/ui/dist/design-system/profile-dropdown/accounts/profile-dropdown-accounts-list.component';
Expand Down Expand Up @@ -145,6 +146,8 @@ export const WalletAccounts = ({ isPopup, onBack }: { isPopup: boolean; onBack:
const name = defaultAccountName(accountIndex);
try {
const timeout = setTimeout(showHWErrorState, HW_CONNECT_TIMEOUT_MS);
if (wallet.type === WalletType.InMemory) return;
await Wallet.connectDevice(wallet.type);
await addAccount({
wallet,
accountIndex,
Expand Down

0 comments on commit 2011d25

Please sign in to comment.