Skip to content

Commit

Permalink
Fix missing imports, lint & hooks deps
Browse files Browse the repository at this point in the history
  • Loading branch information
ofreyssinet-ledger committed Nov 15, 2022
1 parent 3cd28b7 commit f1d7b82
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { memo, useEffect } from "react";
import { useTranslation } from "react-i18next";
import { NativeModules } from "react-native";
import styled, { useTheme } from "styled-components/native";
import { Box, Flex, Icons, Link, Text } from "@ledgerhq/native-ui";
import { CloseMedium } from "@ledgerhq/native-ui/assets/icons";
Expand Down
9 changes: 5 additions & 4 deletions apps/ledger-live-mobile/src/components/SelectDevice/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useCallback, useEffect, useMemo, useState } from "react";
import { StyleSheet, View, Platform, NativeModules } from "react-native";
import { StyleSheet, View, Platform } from "react-native";
import Config from "react-native-config";
import { useSelector, useDispatch } from "react-redux";
import { Trans } from "react-i18next";
Expand Down Expand Up @@ -119,11 +119,12 @@ export default function SelectDevice({
/* ignore */
});
}, [
autoSelectOnAdd,
navigation,
handleOnSelect,
route.name,
promptBluetooth,
navigation,
autoSelectOnAdd,
handleOnSelect,
deviceModelIds,
]);

const renderItem = useCallback(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useNavigation, useRoute } from "@react-navigation/native";
import React, { useCallback, useState } from "react";
import { NativeModules } from "react-native";
import {
BottomDrawer,
Text,
Expand All @@ -22,6 +21,7 @@ import {
StackNavigatorNavigation,
StackNavigatorRoute,
} from "../../../components/RootNavigator/types/helpers";
import { usePromptBluetoothCallback } from "../../../logic/usePromptBluetoothCallback";

const availableDeviceModelFilter = [
"none",
Expand Down Expand Up @@ -57,6 +57,8 @@ export default () => {
>();
const { pairedDevice } = params ?? { pairedDevice: null };

const promptBluetooth = usePromptBluetoothCallback();

const goToBlePairingFlow = useCallback(() => {
setIsDrawerOpen(false);

Expand All @@ -68,7 +70,7 @@ export default () => {

// Prompts user to enable bluetooth before navigating to the screen.
// Not mandatory as BleDevicePairingFlow screen handles the ble requirement, but it smooths the transition
NativeModules.BluetoothHelperModule.prompt()
promptBluetooth()
.then(() => {
const navigateInput: NavigateInput<
BaseNavigatorStackParamList,
Expand Down Expand Up @@ -101,10 +103,11 @@ export default () => {
}, [
params,
navigation,
promptBluetooth,
screenName,
chosenDeviceModelFilter,
areKnownDevicesDisplayed,
onSuccessAddToKnownDevices,
screenName,
]);

const onPress = useCallback(() => {
Expand Down
1 change: 1 addition & 0 deletions apps/ledger-live-mobile/src/screens/SkipSelectDevice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { AddAccountsNavigatorParamList } from "../components/RootNavigator/types
import { StackNavigatorProps } from "../components/RootNavigator/types/helpers";
import { ReceiveFundsStackParamList } from "../components/RootNavigator/types/ReceiveFundsNavigator";
import { ScreenName } from "../const";
import { usePromptBluetoothCallback } from "../logic/usePromptBluetoothCallback";

type Navigation =
| StackNavigatorProps<
Expand Down

0 comments on commit f1d7b82

Please sign in to comment.