From 8fd6a446f2f03d4c8407e1f5f97a804f315a0253 Mon Sep 17 00:00:00 2001 From: tomasklim Date: Tue, 19 Dec 2023 13:41:20 +0100 Subject: [PATCH] fix(suite): security check / onboarding (cherry picked from commit b34fe48f4ca31c759c7cbc78bf5bfec5891e51bf) --- .../onboarding/t2t1-recovery-persistence.test.ts | 6 ++++++ packages/suite/src/views/start/StartContent.tsx | 13 ++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/suite-web/e2e/tests/onboarding/t2t1-recovery-persistence.test.ts b/packages/suite-web/e2e/tests/onboarding/t2t1-recovery-persistence.test.ts index acf2c6347ec..2876852691a 100644 --- a/packages/suite-web/e2e/tests/onboarding/t2t1-recovery-persistence.test.ts +++ b/packages/suite-web/e2e/tests/onboarding/t2t1-recovery-persistence.test.ts @@ -66,6 +66,12 @@ describe('Onboarding - T2T1 in recovery mode', () => { cy.getTestElement('@onboarding/recovery/start-button').click(); cy.getTestElement('@onboarding/confirm-on-device'); cy.task('pressYes'); + cy.wait(1000); + cy.task('pressYes'); + cy.wait(1000); + cy.task('selectNumOfWordsEmu', 20); + cy.wait(1000); + cy.task('pressYes'); cy.wait(501); // wait for device release // disconnect device, reload application diff --git a/packages/suite/src/views/start/StartContent.tsx b/packages/suite/src/views/start/StartContent.tsx index 63b150f88c9..b7436b1a1f2 100644 --- a/packages/suite/src/views/start/StartContent.tsx +++ b/packages/suite/src/views/start/StartContent.tsx @@ -4,7 +4,6 @@ import { DataAnalytics } from '@trezor/components'; import { analytics } from '@trezor/suite-analytics'; import { DOCS_ANALYTICS_URL, DATA_TOS_URL } from '@trezor/urls'; import { selectIsAnalyticsConfirmed } from '@suite-common/analytics'; -import { selectDevice } from '@suite-common/wallet-core'; import { rerun } from 'src/actions/recovery/recoveryActions'; import { PrerequisitesGuide, TrezorLink } from 'src/components/suite'; import { useDispatch, useSelector } from 'src/hooks/suite'; @@ -19,7 +18,6 @@ export const StartContent = () => { const confirmed = useSelector(selectIsAnalyticsConfirmed); const recovery = useSelector(state => state.recovery); const prerequisite = useSelector(selectPrerequisite); - const device = useSelector(selectDevice); const dispatch = useDispatch(); @@ -52,12 +50,13 @@ export const StartContent = () => { /> ); } - if (device) { - return ; - } - if (prerequisite) { + + if ( + prerequisite && + !['device-initialize', 'firmware-missing', 'device-recovery-mode'].includes(prerequisite) + ) { return ; } - return null; + return ; };