Skip to content

Commit

Permalink
enable u2f?
Browse files Browse the repository at this point in the history
  • Loading branch information
blurpesec committed Jun 15, 2020
1 parent e1da5ce commit 7fcf519
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {
BalanceMap
} from '@services/Store/BalanceService';
import { bigify } from '@utils';
import TransportWebUSB from '@ledgerhq/hw-transport-webusb';
import { LedgerU2F } from '../wallets';

interface EventHandlers {
walletId: DPathFormat;
Expand All @@ -30,7 +32,8 @@ export const DeterministicWalletService = ({
}: // walletId
EventHandlers): IDeterministicWalletService => {
const init = async (_: WalletId, asset: ExtendedAsset) => {
const wallet = new LedgerUSB() as Wallet; // @todo - fix the walletId & type
const isWebUSBSupported = await TransportWebUSB.isSupported().catch(() => false);
const wallet = isWebUSBSupported ? new LedgerUSB() : new LedgerU2F(); // @todo - fix the walletId & type
wallet
.initialize()
.then(() => {
Expand Down

0 comments on commit 7fcf519

Please sign in to comment.