From db4c946c3b2384590ef7bd2f691d5009ecb61e17 Mon Sep 17 00:00:00 2001 From: lubej <9722540+lubej@users.noreply.github.com> Date: Tue, 3 Oct 2023 16:45:13 +0200 Subject: [PATCH] Disable Bluetooth Ledger in Web extension --- src/app/pages/OpenWalletPage/Features/FromLedger/index.tsx | 7 ++++--- src/app/pages/OpenWalletPage/webextension.tsx | 4 +--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/app/pages/OpenWalletPage/Features/FromLedger/index.tsx b/src/app/pages/OpenWalletPage/Features/FromLedger/index.tsx index 99c7790859..48498280fa 100644 --- a/src/app/pages/OpenWalletPage/Features/FromLedger/index.tsx +++ b/src/app/pages/OpenWalletPage/Features/FromLedger/index.tsx @@ -10,9 +10,10 @@ import { useNavigate } from 'react-router-dom' type SelectOpenMethodProps = { webExtensionLedgerAccess?: () => void + disableBluetoothLedger?: boolean } -export function FromLedger({ webExtensionLedgerAccess }: SelectOpenMethodProps) { +export function FromLedger({ webExtensionLedgerAccess, disableBluetoothLedger }: SelectOpenMethodProps) { const { t } = useTranslation() const [supportsUsbLedger, setSupportsUsbLedger] = React.useState(true) const [supportsBleLedger, setSupportsBleLedger] = React.useState(true) @@ -21,14 +22,14 @@ export function FromLedger({ webExtensionLedgerAccess }: SelectOpenMethodProps) useEffect(() => { async function getLedgerSupport() { const usbLedgerSupported = await canAccessNavigatorUsb() - const bleLedgerSupported = await canAccessBle() + const bleLedgerSupported = !disableBluetoothLedger && (await canAccessBle()) setSupportsUsbLedger(usbLedgerSupported) setSupportsBleLedger(bleLedgerSupported) } getLedgerSupport() - }, [navigate]) + }, [disableBluetoothLedger, navigate]) return ( openLedgerAccessPopup(href)} /> + return openLedgerAccessPopup(href)} disableBluetoothLedger /> }