Skip to content

Commit

Permalink
fix(recover): change function naming
Browse files Browse the repository at this point in the history
  • Loading branch information
ak-ledger committed Nov 2, 2023
1 parent e4e3803 commit 5152f77
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -188,7 +188,7 @@ export function SelectUseCase({ setUseCase, setOpenedPedagogyModal }: Props) {
);
}}
/>
{checkRecoverCompatibility(servicesConfig, deviceModelId) && (
{isRecoverDisplayed(servicesConfig, deviceModelId) && (
<UseCaseOption
dataTestId="v3-onboarding-restore-using-recover"
id="restore-device"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useFeature, checkRecoverCompatibility } from "@ledgerhq/live-common/featureFlags/index";
import { useFeature, isRecoverDisplayed } from "@ledgerhq/live-common/featureFlags/index";
import {
useAlreadySeededDevicePath,
useRestore24Path,
Expand Down Expand Up @@ -572,7 +572,7 @@ export default function Tutorial({ useCase }: Props) {
fallbackIfNoAction: () => 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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -117,7 +117,7 @@ const OnboardingStepUseCaseSelection = () => {
onPress: onPressRecoveryPhrase,
icon: <Icons.Note color={colors.primary.c80} />,
},
...(checkRecoverCompatibility(servicesConfig, deviceModelId)
...(isRecoverDisplayed(servicesConfig, deviceModelId)
? [
{
title: t("onboarding.stepUseCase.protect.title"),
Expand Down
3 changes: 1 addition & 2 deletions libs/ledger-live-common/src/featureFlags/helper.tsx
Original file line number Diff line number Diff line change
@@ -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(
Expand Down

0 comments on commit 5152f77

Please sign in to comment.