diff --git a/.changeset/green-rice-cheer.md b/.changeset/green-rice-cheer.md new file mode 100644 index 000000000000..cf14d04f993f --- /dev/null +++ b/.changeset/green-rice-cheer.md @@ -0,0 +1,5 @@ +--- +"live-mobile": patch +--- + +Hide Backup section during onboarding on Flex and Stax diff --git a/apps/ledger-live-mobile/src/screens/SyncOnboarding/SyncOnboardingCompanion.tsx b/apps/ledger-live-mobile/src/screens/SyncOnboarding/SyncOnboardingCompanion.tsx index 13a2e30b11c5..79458d1e7f0c 100644 --- a/apps/ledger-live-mobile/src/screens/SyncOnboarding/SyncOnboardingCompanion.tsx +++ b/apps/ledger-live-mobile/src/screens/SyncOnboarding/SyncOnboardingCompanion.tsx @@ -148,6 +148,7 @@ export const SyncOnboardingCompanion: React.FC = ( const { t } = useTranslation(); const dispatchRedux = useDispatch(); const deviceInitialApps = useFeature("deviceInitialApps"); + const recoverUpsellRedirection = useFeature("recoverUpsellRedirection"); const productName = getDeviceModel(device.modelId).productName || device.modelId; const deviceName = device.deviceName || productName; @@ -369,17 +370,22 @@ export const SyncOnboardingCompanion: React.FC = ( if (deviceOnboardingState?.isOnboarded && !seededDeviceHandled.current) { if (deviceOnboardingState?.currentOnboardingStep === DeviceOnboardingStep.Ready) { // device was just seeded - setCompanionStepKey(CompanionStepKey.Backup); + setCompanionStepKey( + recoverUpsellRedirection?.enabled ? CompanionStepKey.Apps : CompanionStepKey.Backup, + ); seededDeviceHandled.current = true; return; } else if ( deviceOnboardingState?.currentOnboardingStep === DeviceOnboardingStep.WelcomeScreen1 ) { - // switch to the apps step - __DEV__ - ? setCompanionStepKey(CompanionStepKey.Backup) // for ease of testing in dev mode without having to reset the device - : setCompanionStepKey(CompanionStepKey.Apps); - + if (recoverUpsellRedirection?.enabled) { + // switch to the apps step + __DEV__ + ? setCompanionStepKey(CompanionStepKey.Backup) // for ease of testing in dev mode without having to reset the device + : setCompanionStepKey(CompanionStepKey.Apps); + } else { + setCompanionStepKey(CompanionStepKey.Apps); + } seededDeviceHandled.current = true; return; } @@ -433,7 +439,12 @@ export const SyncOnboardingCompanion: React.FC = ( default: break; } - }, [deviceOnboardingState, notifyEarlySecurityCheckShouldReset, shouldRestoreApps]); + }, [ + deviceOnboardingState, + notifyEarlySecurityCheckShouldReset, + recoverUpsellRedirection, + shouldRestoreApps, + ]); // When the user gets close to the seed generation step, sets the lost synchronization delay // and timers to a higher value. It avoids having a warning message while the connection is lost @@ -638,17 +649,21 @@ export const SyncOnboardingCompanion: React.FC = ( ), }, - { - key: CompanionStepKey.Backup, - title: t("syncOnboarding.backup.title"), - doneTitle: t("syncOnboarding.backup.title"), - renderBody: () => ( - setCompanionStepKey(CompanionStepKey.Apps)} - /> - ), - }, + ...(recoverUpsellRedirection?.enabled + ? [] + : [ + { + key: CompanionStepKey.Backup, + title: t("syncOnboarding.backup.title"), + doneTitle: t("syncOnboarding.backup.title"), + renderBody: () => ( + setCompanionStepKey(CompanionStepKey.Apps)} + /> + ), + }, + ]), ...(deviceInitialApps?.enabled ? [ { @@ -682,13 +697,14 @@ export const SyncOnboardingCompanion: React.FC = ( [ t, productName, - seedPathStatus, + recoverUpsellRedirection?.enabled, deviceInitialApps?.enabled, device, + seedPathStatus, + shouldRestoreApps, handleInstallAppsComplete, initialAppsToInstall, companionStepKey, - shouldRestoreApps, ], );