From ffd79f45159599922d7bc665d768ac26511224a6 Mon Sep 17 00:00:00 2001 From: kyranjamie Date: Fri, 10 May 2024 10:42:04 +0200 Subject: [PATCH] fix(ledger): use correct key number --- .../ledger-request-bitcoin-keys.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/app/features/ledger/flows/request-bitcoin-keys/ledger-request-bitcoin-keys.tsx b/src/app/features/ledger/flows/request-bitcoin-keys/ledger-request-bitcoin-keys.tsx index b70161901d8..e7aab358f7e 100644 --- a/src/app/features/ledger/flows/request-bitcoin-keys/ledger-request-bitcoin-keys.tsx +++ b/src/app/features/ledger/flows/request-bitcoin-keys/ledger-request-bitcoin-keys.tsx @@ -9,7 +9,10 @@ import { pullBitcoinKeysFromLedgerDevice } from '@app/features/ledger/flows/requ import { ledgerRequestKeysRoutes } from '@app/features/ledger/generic-flows/request-keys/ledger-request-keys-route-generator'; import { LedgerRequestKeysContext } from '@app/features/ledger/generic-flows/request-keys/ledger-request-keys.context'; import { RequestKeysFlow } from '@app/features/ledger/generic-flows/request-keys/request-keys-flow'; -import { useRequestLedgerKeys } from '@app/features/ledger/generic-flows/request-keys/use-request-ledger-keys'; +import { + defaultNumberOfKeysToPullFromLedgerDevice, + useRequestLedgerKeys, +} from '@app/features/ledger/generic-flows/request-keys/use-request-ledger-keys'; import { useLedgerNavigate } from '@app/features/ledger/hooks/use-ledger-navigate'; import { connectLedgerBitcoinApp, @@ -28,7 +31,7 @@ function LedgerRequestBitcoinKeys() { const ledgerNavigate = useLedgerNavigate(); const network = useCurrentNetwork(); - const chain = 'bitcoin' as const; + const chain = 'bitcoin'; const { requestKeys, latestDeviceResponse, awaitingDeviceConnection } = useRequestLedgerKeys({ @@ -45,11 +48,13 @@ function LedgerRequestBitcoinKeys() { onRequestKey(index) { if (index <= 4) { ledgerNavigate.toDeviceBusyStep( - `Requesting Bitcoin Native Segwit address (${index + 1}…5)` + `Requesting Bitcoin Native Segwit address (${index + 1}…${defaultNumberOfKeysToPullFromLedgerDevice})` ); return; } - ledgerNavigate.toDeviceBusyStep(`Requesting Bitcoin Taproot address (${index - 4}…5)`); + ledgerNavigate.toDeviceBusyStep( + `Requesting Bitcoin Taproot address (${index - 4}…${defaultNumberOfKeysToPullFromLedgerDevice})` + ); }, }); dispatch(bitcoinKeysSlice.actions.addKeys(keys));