diff --git a/apps/ledger-live-desktop/src/renderer/components/Onboarding/Screens/SelectUseCase/index.tsx b/apps/ledger-live-desktop/src/renderer/components/Onboarding/Screens/SelectUseCase/index.tsx index 8efd17df5072..62647aba4740 100644 --- a/apps/ledger-live-desktop/src/renderer/components/Onboarding/Screens/SelectUseCase/index.tsx +++ b/apps/ledger-live-desktop/src/renderer/components/Onboarding/Screens/SelectUseCase/index.tsx @@ -3,7 +3,7 @@ import { useHistory } from "react-router-dom"; import { useTranslation, Trans } from "react-i18next"; import { Flex, Text } from "@ledgerhq/react-ui"; import { DeviceModelId } from "@ledgerhq/devices"; -import { useFeature, checkRecoverCompatibility } from "@ledgerhq/live-common/featureFlags/index"; +import { useFeature, isRecoverDisplayed } from "@ledgerhq/live-common/featureFlags/index"; import { useDispatch } from "react-redux"; import styled from "styled-components"; import { UseCaseOption } from "./UseCaseOption"; @@ -188,7 +188,7 @@ export function SelectUseCase({ setUseCase, setOpenedPedagogyModal }: Props) { ); }} /> - {checkRecoverCompatibility(servicesConfig, deviceModelId) && ( + {isRecoverDisplayed(servicesConfig, deviceModelId) && ( history.push("/"), }); - if (checkRecoverCompatibility(recoverFF, connectedDevice?.modelId)) { + if (isRecoverDisplayed(recoverFF, connectedDevice?.modelId)) { if (useCase === UseCase.setupDevice && upsellPath) { history.push(upsellPath); } else if (useCase === UseCase.recoveryPhrase && restore24Path) { diff --git a/apps/ledger-live-mobile/src/screens/Onboarding/steps/useCaseSelection.tsx b/apps/ledger-live-mobile/src/screens/Onboarding/steps/useCaseSelection.tsx index c7c3b481ebe5..7d5a4d8d46d8 100644 --- a/apps/ledger-live-mobile/src/screens/Onboarding/steps/useCaseSelection.tsx +++ b/apps/ledger-live-mobile/src/screens/Onboarding/steps/useCaseSelection.tsx @@ -1,5 +1,5 @@ import { DeviceModelId, getDeviceModel } from "@ledgerhq/devices"; -import { useFeature, checkRecoverCompatibility } from "@ledgerhq/live-common/featureFlags/index"; +import { useFeature, isRecoverDisplayed } from "@ledgerhq/live-common/featureFlags/index"; import { Flex, Icons, Text } from "@ledgerhq/native-ui"; import { useNavigation, useRoute } from "@react-navigation/native"; import React, { useState } from "react"; @@ -117,7 +117,7 @@ const OnboardingStepUseCaseSelection = () => { onPress: onPressRecoveryPhrase, icon: , }, - ...(checkRecoverCompatibility(servicesConfig, deviceModelId) + ...(isRecoverDisplayed(servicesConfig, deviceModelId) ? [ { title: t("onboarding.stepUseCase.protect.title"), diff --git a/libs/ledger-live-common/src/featureFlags/helper.tsx b/libs/ledger-live-common/src/featureFlags/helper.tsx index cc48be7fa77a..b1f6c4639fc9 100644 --- a/libs/ledger-live-common/src/featureFlags/helper.tsx +++ b/libs/ledger-live-common/src/featureFlags/helper.tsx @@ -1,5 +1,4 @@ -// Recover compatibility check function, based on feature and device -export function checkRecoverCompatibility(feature, deviceModelId) { +export function isRecoverDisplayed(feature, deviceModelId) { return ( feature?.enabled && feature?.params?.compatibleDevices?.find(