Skip to content

Commit

Permalink
fix(suite): security check / onboarding
Browse files Browse the repository at this point in the history
(cherry picked from commit b34fe48)
  • Loading branch information
tomasklim authored and komret committed Dec 19, 2023
1 parent 148bab6 commit 8fd6a44
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 6 additions & 7 deletions packages/suite/src/views/start/StartContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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();

Expand Down Expand Up @@ -52,12 +50,13 @@ export const StartContent = () => {
/>
);
}
if (device) {
return <SecurityCheck />;
}
if (prerequisite) {

if (
prerequisite &&
!['device-initialize', 'firmware-missing', 'device-recovery-mode'].includes(prerequisite)
) {
return <PrerequisitesGuide />;
}

return null;
return <SecurityCheck />;
};

0 comments on commit 8fd6a44

Please sign in to comment.