Skip to content

Commit

Permalink
fixup! feat(suite-native): onboarding seedless device landing screen
Browse files Browse the repository at this point in the history
  • Loading branch information
PeKne committed Jan 29, 2025
1 parent bc41598 commit 94fe6b8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
11 changes: 3 additions & 8 deletions suite-native/device/src/hooks/useHandleDeviceConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const useHandleDeviceConnection = () => {
!isDeviceInitialized &&
isDeviceConnected &&
isOnboardingFinished &&
!isNoPhysicalDeviceConnected &&
!isPortfolioTrackerDevice &&
!isBiometricsOverlayVisible
) {
requestPrioritizedDeviceAccess({
Expand All @@ -88,7 +88,7 @@ export const useHandleDeviceConnection = () => {
isBiometricsOverlayVisible,
navigation,
isDeviceInitialized,
isNoPhysicalDeviceConnected,
isPortfolioTrackerDevice,
isDeviceSetupSupported,
]);

Expand Down Expand Up @@ -138,12 +138,7 @@ export const useHandleDeviceConnection = () => {
if (isFirmwareInstallationRunning) return;

if (isNoPhysicalDeviceConnected && isOnboardingFinished) {
const previousRoute = navigation.getState()?.routes.at(-1)?.name;

// This accidentally gets triggered by finishing onboarding with no device connected,
// so this prevents from redirect being duplicated.
const isPreviousRouteOnboarding = previousRoute === RootStackRoutes.OnboardingStack;
if (isPreviousRouteOnboarding || shouldBlockSendReviewRedirect) {
if (shouldBlockSendReviewRedirect) {
return;
}
navigation.navigate(RootStackRoutes.AppTabs, {
Expand Down
8 changes: 3 additions & 5 deletions suite-native/device/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { AnyAction } from '@reduxjs/toolkit';
import * as semver from 'semver';

import { Device, DEVICE, DeviceEvent, DeviceModelInternal, VersionArray } from '@trezor/connect';
import { UnreachableCaseError } from '@suite-common/suite-utils';

export const minimalSupportedFirmwareVersion = {
UNKNOWN: [0, 0, 0] as VersionArray,
Expand Down Expand Up @@ -50,10 +51,7 @@ export const isDeviceSetupSupported = (model: DeviceModelInternal) => {
case DeviceModelInternal.T3W1:
case DeviceModelInternal.UNKNOWN:
return false;
default: {
const exhaustiveCheck: never = model;

return exhaustiveCheck;
}
default:
throw new UnreachableCaseError(model);
}
};
Binary file modified suite-native/module-onboarding/src/assets/trezorSafe3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified suite-native/module-onboarding/src/assets/trezorSafe5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 94fe6b8

Please sign in to comment.