Skip to content

Commit

Permalink
Merge branch 'main' into fix-read-only-sign-blank
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadowfiend authored Feb 25, 2022
2 parents 9940e7c + 0df335b commit 2bc909d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 4 additions & 0 deletions background/services/ledger/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { getOrCreateDB, LedgerDatabase } from "./db"
import { ethersTransactionRequestFromEIP1559TransactionRequest } from "../chain/utils"
import { ETH } from "../../constants"
import { normalizeEVMAddress } from "../../lib/utils"
import { HIDE_IMPORT_LEDGER } from "../../features/features"

enum LedgerType {
UNKNOWN,
Expand All @@ -37,6 +38,9 @@ export const LedgerProductDatabase = {
LEDGER_NANO_X: { productId: 0x4015 },
}

export const isLedgerSupported =
!HIDE_IMPORT_LEDGER && typeof navigator.usb === "object"

const TestedProductId = (productId: number): boolean => {
return Object.values(LedgerProductDatabase).some(
(e) => e.productId === productId
Expand Down
6 changes: 2 additions & 4 deletions ui/pages/Onboarding/OnboardingAddWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React, { ReactElement } from "react"
import {
HIDE_ADD_SEED,
HIDE_CREATE_PHRASE,
HIDE_IMPORT_LEDGER,
} from "@tallyho/tally-background/features/features"
import { isLedgerSupported } from "@tallyho/tally-background/services/ledger"
import SharedBackButton from "../../components/Shared/SharedBackButton"
import SharedButton from "../../components/Shared/SharedButton"

Expand Down Expand Up @@ -45,9 +45,7 @@ export default function OnboardingStartTheHunt(): ReactElement {
</SharedButton>
</li>
)}
{HIDE_IMPORT_LEDGER ? (
<></>
) : (
{isLedgerSupported && (
<li className="option standard_width">
<div className="icon ledger_icon" />
<SharedButton
Expand Down

0 comments on commit 2bc909d

Please sign in to comment.