diff --git a/src/app/routes/onboarding-gate.tsx b/src/app/routes/onboarding-gate.tsx index 619022a117b..9ba0efb67ea 100644 --- a/src/app/routes/onboarding-gate.tsx +++ b/src/app/routes/onboarding-gate.tsx @@ -4,6 +4,7 @@ import { Navigate } from 'react-router-dom'; import { RouteUrls } from '@shared/route-urls'; import { useDefaultWalletSecretKey } from '@app/store/in-memory-key/in-memory-key.selectors'; +import { useHasLedgerKeys } from '@app/store/ledger/ledger.selectors'; import { useCurrentKeyDetails } from '@app/store/software-keys/software-key.selectors'; function hasAlreadyMadeWalletAndPlaintextKeyInMemory(encryptedKey?: string, inMemoryKey?: string) { @@ -20,10 +21,15 @@ interface OnboardingGateProps { export function OnboardingGate({ children }: OnboardingGateProps) { const keyDetails = useCurrentKeyDetails(); const currentInMemoryKey = useDefaultWalletSecretKey(); + const isLedger = useHasLedgerKeys(); if ( - keyDetails?.type === 'software' && - hasAlreadyMadeWalletAndPlaintextKeyInMemory(keyDetails.encryptedSecretKey, currentInMemoryKey) + (keyDetails?.type === 'software' && + hasAlreadyMadeWalletAndPlaintextKeyInMemory( + keyDetails.encryptedSecretKey, + currentInMemoryKey + )) || + isLedger ) { return ; }