DEL: Remove package

This commit is contained in:
Marcos Rodriguez Velez 2024-06-03 21:27:21 -04:00
parent 9b6434715e
commit fc4dddd1df
No known key found for this signature in database
GPG Key ID: 6030B2F48CCE86D7
13 changed files with 102 additions and 116 deletions

View File

@ -1,4 +1,4 @@
import { createNavigationContainerRef, NavigationAction, ParamListBase } from '@react-navigation/native'; import { createNavigationContainerRef, NavigationAction, ParamListBase, StackActions } from '@react-navigation/native';
export const navigationRef = createNavigationContainerRef<ParamListBase>(); export const navigationRef = createNavigationContainerRef<ParamListBase>();
@ -18,7 +18,13 @@ export function reset() {
if (navigationRef.isReady()) { if (navigationRef.isReady()) {
navigationRef.current?.reset({ navigationRef.current?.reset({
index: 0, index: 0,
routes: [{ name: 'UnlockWithScreenRoot' }], routes: [{ name: 'UnlockWithScreen' }],
}); });
} }
} }
export function popToTop() {
if (navigationRef.isReady()) {
navigationRef.current?.dispatch(StackActions.popToTop());
}
}

View File

@ -6,7 +6,7 @@ import { ListItem } from 'react-native-elements';
import Share from 'react-native-share'; import Share from 'react-native-share';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback'; import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import confirm from '../../helpers/confirm'; import confirm from '../../helpers/confirm';
import { useBiometrics } from '../../hooks/useBiometrics'; import { unlockWithBiometrics, useBiometrics } from '../../hooks/useBiometrics';
import loc, { formatBalance } from '../../loc'; import loc, { formatBalance } from '../../loc';
import { BitcoinUnit } from '../../models/bitcoinUnits'; import { BitcoinUnit } from '../../models/bitcoinUnits';
import presentAlert from '../Alert'; import presentAlert from '../Alert';
@ -32,7 +32,7 @@ type NavigationProps = NativeStackNavigationProp<DetailViewStackParamList>;
const AddressItem = ({ item, balanceUnit, walletID, allowSignVerifyMessage }: AddressItemProps) => { const AddressItem = ({ item, balanceUnit, walletID, allowSignVerifyMessage }: AddressItemProps) => {
const { wallets } = useStorage(); const { wallets } = useStorage();
const { colors } = useTheme(); const { colors } = useTheme();
const { isBiometricUseCapableAndEnabled, unlockWithBiometrics } = useBiometrics(); const { isBiometricUseCapableAndEnabled } = useBiometrics();
const hasTransactions = item.transactions > 0; const hasTransactions = item.transactions > 0;

View File

@ -1,7 +1,6 @@
import { useState, useEffect } from 'react'; import { useState, useEffect, useCallback } from 'react';
import { Alert, Platform } from 'react-native'; import { Alert, Platform } from 'react-native';
import ReactNativeBiometrics, { BiometryTypes as RNBiometryTypes } from 'react-native-biometrics'; import ReactNativeBiometrics, { BiometryTypes as RNBiometryTypes } from 'react-native-biometrics';
import PasscodeAuth from 'react-native-passcode-auth';
import RNSecureKeyStore, { ACCESSIBLE } from 'react-native-secure-key-store'; import RNSecureKeyStore, { ACCESSIBLE } from 'react-native-secure-key-store';
import loc from '../loc'; import loc from '../loc';
import * as NavigationService from '../NavigationService'; import * as NavigationService from '../NavigationService';
@ -17,18 +16,18 @@ const Biometrics = 'Biometrics';
const clearKeychain = async () => { const clearKeychain = async () => {
try { try {
console.log('Wiping keychain'); console.debug('Wiping keychain');
console.log('Wiping key: data'); console.debug('Wiping key: data');
await RNSecureKeyStore.set('data', JSON.stringify({ data: { wallets: [] } }), { await RNSecureKeyStore.set('data', JSON.stringify({ data: { wallets: [] } }), {
accessible: ACCESSIBLE.WHEN_UNLOCKED_THIS_DEVICE_ONLY, accessible: ACCESSIBLE.WHEN_UNLOCKED_THIS_DEVICE_ONLY,
}); });
console.log('Wiped key: data'); console.debug('Wiped key: data');
console.log('Wiping key: data_encrypted'); console.debug('Wiping key: data_encrypted');
await RNSecureKeyStore.set('data_encrypted', '', { accessible: ACCESSIBLE.WHEN_UNLOCKED_THIS_DEVICE_ONLY }); await RNSecureKeyStore.set('data_encrypted', '', { accessible: ACCESSIBLE.WHEN_UNLOCKED_THIS_DEVICE_ONLY });
console.log('Wiped key: data_encrypted'); console.debug('Wiped key: data_encrypted');
console.log('Wiping key: STORAGEKEY'); console.debug('Wiping key: STORAGEKEY');
await RNSecureKeyStore.set(STORAGEKEY, '', { accessible: ACCESSIBLE.WHEN_UNLOCKED_THIS_DEVICE_ONLY }); await RNSecureKeyStore.set(STORAGEKEY, '', { accessible: ACCESSIBLE.WHEN_UNLOCKED_THIS_DEVICE_ONLY });
console.log('Wiped key: STORAGEKEY'); console.debug('Wiped key: STORAGEKEY');
NavigationService.reset(); NavigationService.reset();
} catch (error: any) { } catch (error: any) {
console.warn(error); console.warn(error);
@ -36,12 +35,59 @@ const clearKeychain = async () => {
} }
}; };
const requestDevicePasscode = async () => { const unlockWithBiometrics = async () => {
let isDevicePasscodeSupported: boolean | undefined = false;
try { try {
isDevicePasscodeSupported = await PasscodeAuth.isSupported(); const { available } = await rnBiometrics.isSensorAvailable();
if (isDevicePasscodeSupported) { if (!available) {
const isAuthenticated = await PasscodeAuth.authenticate(); return false;
}
return new Promise<boolean>(resolve => {
rnBiometrics
.simplePrompt({ promptMessage: loc.settings.biom_conf_identity })
.then((result: { success: any }) => {
if (result.success) {
resolve(true);
} else {
console.debug('Biometrics authentication failed');
resolve(false);
}
})
.catch((error: Error) => {
console.debug('Biometrics authentication error');
presentAlert({ message: error.message });
resolve(false);
});
});
} catch (e: Error | any) {
console.debug('Biometrics authentication error', e);
presentAlert({ message: e.message });
return false;
}
};
const showKeychainWipeAlert = () => {
if (Platform.OS === 'ios') {
Alert.alert(
loc.settings.encrypt_tstorage,
loc.settings.biom_10times,
[
{
text: loc._.cancel,
onPress: () => {
console.debug('Cancel Pressed');
},
style: 'cancel',
},
{
text: loc._.ok,
onPress: async () => {
const { available } = await rnBiometrics.isSensorAvailable();
if (!available) {
presentAlert({ message: loc.settings.biom_no_passcode });
return;
}
const isAuthenticated = await unlockWithBiometrics();
if (isAuthenticated) { if (isAuthenticated) {
Alert.alert( Alert.alert(
loc.settings.encrypt_tstorage, loc.settings.encrypt_tstorage,
@ -57,31 +103,7 @@ const requestDevicePasscode = async () => {
{ cancelable: false }, { cancelable: false },
); );
} }
}
} catch {
isDevicePasscodeSupported = undefined;
}
if (isDevicePasscodeSupported === false) {
presentAlert({ message: loc.settings.biom_no_passcode });
}
};
const showKeychainWipeAlert = () => {
if (Platform.OS === 'ios') {
Alert.alert(
loc.settings.encrypt_tstorage,
loc.settings.biom_10times,
[
{
text: loc._.cancel,
onPress: () => {
console.log('Cancel Pressed');
}, },
style: 'cancel',
},
{
text: loc._.ok,
onPress: () => requestDevicePasscode(),
style: 'default', style: 'default',
}, },
], ],
@ -108,19 +130,20 @@ const useBiometrics = () => {
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, []); }, []);
const isDeviceBiometricCapable = async () => { const isDeviceBiometricCapable = useCallback(async () => {
try { try {
const { available } = await rnBiometrics.isSensorAvailable(); const { available } = await rnBiometrics.isSensorAvailable();
return available; return available;
} catch (e) { } catch (e) {
console.log('Biometrics isDeviceBiometricCapable failed'); console.debug('Biometrics isDeviceBiometricCapable failed');
console.log(e); console.debug(e);
setBiometricUseEnabled(false); setBiometricUseEnabled(false);
} }
return false; return false;
}; // eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const type = async () => { const type = useCallback(async () => {
try { try {
const { available, biometryType } = await rnBiometrics.isSensorAvailable(); const { available, biometryType } = await rnBiometrics.isSensorAvailable();
if (!available) { if (!available) {
@ -129,55 +152,34 @@ const useBiometrics = () => {
return biometryType; return biometryType;
} catch (e) { } catch (e) {
console.log('Biometrics biometricType failed'); console.debug('Biometrics biometricType failed');
console.log(e); console.debug(e);
return undefined; return undefined;
} }
}; }, []);
const isBiometricUseEnabled = async () => { const isBiometricUseEnabled = useCallback(async () => {
try { try {
const enabledBiometrics = await getItem(STORAGEKEY); const enabledBiometrics = await getItem(STORAGEKEY);
return !!enabledBiometrics; return !!enabledBiometrics;
} catch (_) {} } catch (_) {}
return false; return false;
}; }, [getItem]);
const isBiometricUseCapableAndEnabled = async () => { const isBiometricUseCapableAndEnabled = useCallback(async () => {
const isEnabled = await isBiometricUseEnabled(); const isEnabled = await isBiometricUseEnabled();
const isCapable = await isDeviceBiometricCapable(); const isCapable = await isDeviceBiometricCapable();
return isEnabled && isCapable; return isEnabled && isCapable;
}; }, [isBiometricUseEnabled, isDeviceBiometricCapable]);
const setBiometricUseEnabled = async (value: boolean) => { const setBiometricUseEnabled = useCallback(
async (value: boolean) => {
await setItem(STORAGEKEY, value === true ? '1' : ''); await setItem(STORAGEKEY, value === true ? '1' : '');
setBiometricEnabled(value); setBiometricEnabled(value);
}; },
[setItem],
const unlockWithBiometrics = async () => { );
const isCapable = await isDeviceBiometricCapable();
if (isCapable) {
return new Promise(resolve => {
rnBiometrics
.simplePrompt({ promptMessage: loc.settings.biom_conf_identity })
.then((result: { success: any }) => {
if (result.success) {
resolve(true);
} else {
console.log('Biometrics authentication failed');
resolve(false);
}
})
.catch((error: Error) => {
console.log('Biometrics authentication error');
presentAlert({ message: error.message });
resolve(false);
});
});
}
return false;
};
return { return {
isDeviceBiometricCapable, isDeviceBiometricCapable,
@ -185,11 +187,9 @@ const useBiometrics = () => {
isBiometricUseEnabled, isBiometricUseEnabled,
isBiometricUseCapableAndEnabled, isBiometricUseCapableAndEnabled,
setBiometricUseEnabled, setBiometricUseEnabled,
unlockWithBiometrics,
clearKeychain, clearKeychain,
requestDevicePasscode,
biometricEnabled, biometricEnabled,
}; };
}; };
export { FaceID, TouchID, Biometrics, RNBiometryTypes as BiometricType, useBiometrics, showKeychainWipeAlert }; export { FaceID, TouchID, Biometrics, RNBiometryTypes as BiometricType, useBiometrics, showKeychainWipeAlert, unlockWithBiometrics };

View File

@ -1,7 +1,7 @@
import { useNavigation, NavigationProp, ParamListBase } from '@react-navigation/native'; import { useNavigation, NavigationProp, ParamListBase } from '@react-navigation/native';
import { navigationRef } from '../NavigationService'; import { navigationRef } from '../NavigationService';
import { presentWalletExportReminder } from '../helpers/presentWalletExportReminder'; import { presentWalletExportReminder } from '../helpers/presentWalletExportReminder';
import { useBiometrics } from './useBiometrics'; import { unlockWithBiometrics, useBiometrics } from './useBiometrics';
import { useStorage } from './context/useStorage'; import { useStorage } from './context/useStorage';
// List of screens that require biometrics // List of screens that require biometrics
@ -13,7 +13,7 @@ const requiresWalletExportIsSaved = ['ReceiveDetailsRoot', 'WalletAddresses'];
export const useExtendedNavigation = <T extends NavigationProp<ParamListBase>>(): T => { export const useExtendedNavigation = <T extends NavigationProp<ParamListBase>>(): T => {
const originalNavigation = useNavigation<T>(); const originalNavigation = useNavigation<T>();
const { wallets, saveToDisk } = useStorage(); const { wallets, saveToDisk } = useStorage();
const { isBiometricUseEnabled, unlockWithBiometrics } = useBiometrics(); const { isBiometricUseEnabled } = useBiometrics();
const enhancedNavigate: NavigationProp<ParamListBase>['navigate'] = (screenOrOptions: any, params?: any) => { const enhancedNavigate: NavigationProp<ParamListBase>['navigate'] = (screenOrOptions: any, params?: any) => {
let screenName: string; let screenName: string;

View File

@ -24,8 +24,6 @@ PODS:
- lottie-react-native (6.7.2): - lottie-react-native (6.7.2):
- lottie-ios (= 4.4.1) - lottie-ios (= 4.4.1)
- React-Core - React-Core
- PasscodeAuth (1.0.0):
- React
- RCT-Folly (2021.07.22.00): - RCT-Folly (2021.07.22.00):
- boost - boost
- DoubleConversion - DoubleConversion
@ -530,7 +528,6 @@ DEPENDENCIES:
- hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`) - hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
- libevent (~> 2.1.12) - libevent (~> 2.1.12)
- lottie-react-native (from `../node_modules/lottie-react-native`) - lottie-react-native (from `../node_modules/lottie-react-native`)
- PasscodeAuth (from `../node_modules/react-native-passcode-auth`)
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
- RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
@ -629,8 +626,6 @@ EXTERNAL SOURCES:
:podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec" :podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec"
lottie-react-native: lottie-react-native:
:path: "../node_modules/lottie-react-native" :path: "../node_modules/lottie-react-native"
PasscodeAuth:
:path: "../node_modules/react-native-passcode-auth"
RCT-Folly: RCT-Folly:
:podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec" :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
RCTRequired: RCTRequired:
@ -784,7 +779,6 @@ SPEC CHECKSUMS:
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
lottie-ios: e047b1d2e6239b787cc5e9755b988869cf190494 lottie-ios: e047b1d2e6239b787cc5e9755b988869cf190494
lottie-react-native: 17547b2f3c7034e2ae8672833fdb63262164d18a lottie-react-native: 17547b2f3c7034e2ae8672833fdb63262164d18a
PasscodeAuth: 3e88093ff46c31a952d8b36c488240de980517be
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1 RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
RCTRequired: 264adaca1d8b1a9c078761891898d4142df05313 RCTRequired: 264adaca1d8b1a9c078761891898d4142df05313
RCTTypeSafety: 279a89da7058a69899778a127be73fab38b84499 RCTTypeSafety: 279a89da7058a69899778a127be73fab38b84499

View File

@ -240,7 +240,7 @@
"biometrics_no_longer_available": "Your device settings have changed and no longer match the selected security settings in the app. Please re-enable biometrics or passcode, then restart the app to apply these changes.", "biometrics_no_longer_available": "Your device settings have changed and no longer match the selected security settings in the app. Please re-enable biometrics or passcode, then restart the app to apply these changes.",
"biom_10times": "You have attempted to enter your password 10 times. Would you like to reset your storage? This will remove all wallets and decrypt your storage.", "biom_10times": "You have attempted to enter your password 10 times. Would you like to reset your storage? This will remove all wallets and decrypt your storage.",
"biom_conf_identity": "Please confirm your identity.", "biom_conf_identity": "Please confirm your identity.",
"biom_no_passcode": "Your device does not have a passcode. In order to proceed, please configure a passcode in the Settings app.", "biom_no_passcode": "Your device does not have a passcode or biometrics enabled. In order to proceed, please configure a passcode or biometric in the Settings app.",
"biom_remove_decrypt": "All your wallets will be removed and your storage will be decrypted. Are you sure you want to proceed?", "biom_remove_decrypt": "All your wallets will be removed and your storage will be decrypted. Are you sure you want to proceed?",
"currency": "Currency", "currency": "Currency",
"currency_source": "Price is obtained from", "currency_source": "Price is obtained from",

12
package-lock.json generated
View File

@ -79,7 +79,6 @@
"react-native-localize": "3.1.0", "react-native-localize": "3.1.0",
"react-native-modal": "13.0.1", "react-native-modal": "13.0.1",
"react-native-obscure": "https://github.com/BlueWallet/react-native-obscure.git#f4b83b4a261e39b1f5ed4a45ac5bcabc8a59eadb", "react-native-obscure": "https://github.com/BlueWallet/react-native-obscure.git#f4b83b4a261e39b1f5ed4a45ac5bcabc8a59eadb",
"react-native-passcode-auth": "https://github.com/BlueWallet/react-native-passcode-auth#a2ff977ba92b36f8d0a5567f59c05cc608e8bd12",
"react-native-permissions": "4.1.5", "react-native-permissions": "4.1.5",
"react-native-privacy-snapshot": "https://github.com/BlueWallet/react-native-privacy-snapshot#529e4627d93f67752a27e82a040ff7b64dca0783", "react-native-privacy-snapshot": "https://github.com/BlueWallet/react-native-privacy-snapshot#529e4627d93f67752a27e82a040ff7b64dca0783",
"react-native-prompt-android": "https://github.com/BlueWallet/react-native-prompt-android#ed168d66fed556bc2ed07cf498770f058b78a376", "react-native-prompt-android": "https://github.com/BlueWallet/react-native-prompt-android#ed168d66fed556bc2ed07cf498770f058b78a376",
@ -19775,12 +19774,6 @@
"react-native": "^0.60.5" "react-native": "^0.60.5"
} }
}, },
"node_modules/react-native-passcode-auth": {
"version": "1.0.0",
"resolved": "git+ssh://git@github.com/BlueWallet/react-native-passcode-auth.git#a2ff977ba92b36f8d0a5567f59c05cc608e8bd12",
"integrity": "sha512-8FL4NDMZZVrbHr1f4555dV+GY3PLpmSbJ1wIbdW1r6zSaFe59g9ns4sdLliisjO+RvyDJP7UDPDaeu+2iJ26Bg==",
"license": "ISC"
},
"node_modules/react-native-permissions": { "node_modules/react-native-permissions": {
"version": "4.1.5", "version": "4.1.5",
"resolved": "https://registry.npmjs.org/react-native-permissions/-/react-native-permissions-4.1.5.tgz", "resolved": "https://registry.npmjs.org/react-native-permissions/-/react-native-permissions-4.1.5.tgz",
@ -37528,11 +37521,6 @@
"integrity": "sha512-bmzbnlXII8hW7steqwouzQW9cJ+mdA8HJ8pWkb0KD60jC5dYgJ0e66wgUiSTDNFPrvlEKriE4eEanoJFj7Q9pg==", "integrity": "sha512-bmzbnlXII8hW7steqwouzQW9cJ+mdA8HJ8pWkb0KD60jC5dYgJ0e66wgUiSTDNFPrvlEKriE4eEanoJFj7Q9pg==",
"from": "react-native-obscure@https://github.com/BlueWallet/react-native-obscure.git#f4b83b4a261e39b1f5ed4a45ac5bcabc8a59eadb" "from": "react-native-obscure@https://github.com/BlueWallet/react-native-obscure.git#f4b83b4a261e39b1f5ed4a45ac5bcabc8a59eadb"
}, },
"react-native-passcode-auth": {
"version": "git+ssh://git@github.com/BlueWallet/react-native-passcode-auth.git#a2ff977ba92b36f8d0a5567f59c05cc608e8bd12",
"integrity": "sha512-8FL4NDMZZVrbHr1f4555dV+GY3PLpmSbJ1wIbdW1r6zSaFe59g9ns4sdLliisjO+RvyDJP7UDPDaeu+2iJ26Bg==",
"from": "react-native-passcode-auth@https://github.com/BlueWallet/react-native-passcode-auth#a2ff977ba92b36f8d0a5567f59c05cc608e8bd12"
},
"react-native-permissions": { "react-native-permissions": {
"version": "4.1.5", "version": "4.1.5",
"resolved": "https://registry.npmjs.org/react-native-permissions/-/react-native-permissions-4.1.5.tgz", "resolved": "https://registry.npmjs.org/react-native-permissions/-/react-native-permissions-4.1.5.tgz",

View File

@ -164,7 +164,6 @@
"react-native-localize": "3.1.0", "react-native-localize": "3.1.0",
"react-native-modal": "13.0.1", "react-native-modal": "13.0.1",
"react-native-obscure": "https://github.com/BlueWallet/react-native-obscure.git#f4b83b4a261e39b1f5ed4a45ac5bcabc8a59eadb", "react-native-obscure": "https://github.com/BlueWallet/react-native-obscure.git#f4b83b4a261e39b1f5ed4a45ac5bcabc8a59eadb",
"react-native-passcode-auth": "https://github.com/BlueWallet/react-native-passcode-auth#a2ff977ba92b36f8d0a5567f59c05cc608e8bd12",
"react-native-permissions": "4.1.5", "react-native-permissions": "4.1.5",
"react-native-privacy-snapshot": "https://github.com/BlueWallet/react-native-privacy-snapshot#529e4627d93f67752a27e82a040ff7b64dca0783", "react-native-privacy-snapshot": "https://github.com/BlueWallet/react-native-privacy-snapshot#529e4627d93f67752a27e82a040ff7b64dca0783",
"react-native-prompt-android": "https://github.com/BlueWallet/react-native-prompt-android#ed168d66fed556bc2ed07cf498770f058b78a376", "react-native-prompt-android": "https://github.com/BlueWallet/react-native-prompt-android#ed168d66fed556bc2ed07cf498770f058b78a376",

View File

@ -4,7 +4,7 @@ import triggerHapticFeedback, { HapticFeedbackTypes } from '../blue_modules/hapt
import { BlueTextCentered } from '../BlueComponents'; import { BlueTextCentered } from '../BlueComponents';
import Button from '../components/Button'; import Button from '../components/Button';
import SafeArea from '../components/SafeArea'; import SafeArea from '../components/SafeArea';
import { BiometricType, useBiometrics } from '../hooks/useBiometrics'; import { BiometricType, unlockWithBiometrics, useBiometrics } from '../hooks/useBiometrics';
import loc from '../loc'; import loc from '../loc';
import { useStorage } from '../hooks/context/useStorage'; import { useStorage } from '../hooks/context/useStorage';
@ -53,7 +53,7 @@ const UnlockWith: React.FC = () => {
const [state, dispatch] = useReducer(reducer, initialState); const [state, dispatch] = useReducer(reducer, initialState);
const isUnlockingWallets = useRef(false); const isUnlockingWallets = useRef(false);
const { setWalletsInitialized, isStorageEncrypted, startAndDecrypt } = useStorage(); const { setWalletsInitialized, isStorageEncrypted, startAndDecrypt } = useStorage();
const { deviceBiometricType, unlockWithBiometrics, isBiometricUseCapableAndEnabled, isBiometricUseEnabled } = useBiometrics(); const { deviceBiometricType, isBiometricUseCapableAndEnabled, isBiometricUseEnabled } = useBiometrics();
useEffect(() => { useEffect(() => {
setWalletsInitialized(false); setWalletsInitialized(false);

View File

@ -14,7 +14,7 @@ import { ArrowPicker } from '../../components/ArrowPicker';
import Button from '../../components/Button'; import Button from '../../components/Button';
import SafeArea from '../../components/SafeArea'; import SafeArea from '../../components/SafeArea';
import { useTheme } from '../../components/themes'; import { useTheme } from '../../components/themes';
import { useBiometrics } from '../../hooks/useBiometrics'; import { unlockWithBiometrics, useBiometrics } from '../../hooks/useBiometrics';
import loc from '../../loc'; import loc from '../../loc';
import { BitcoinUnit } from '../../models/bitcoinUnits'; import { BitcoinUnit } from '../../models/bitcoinUnits';
import { useStorage } from '../../hooks/context/useStorage'; import { useStorage } from '../../hooks/context/useStorage';
@ -34,7 +34,7 @@ type LdkOpenChannelProps = RouteProp<
const LdkOpenChannel = (props: any) => { const LdkOpenChannel = (props: any) => {
const { wallets, fetchAndSaveWalletTransactions } = useStorage(); const { wallets, fetchAndSaveWalletTransactions } = useStorage();
const { isBiometricUseCapableAndEnabled, unlockWithBiometrics } = useBiometrics(); const { isBiometricUseCapableAndEnabled } = useBiometrics();
const { colors }: { colors: any } = useTheme(); const { colors }: { colors: any } = useTheme();
const { navigate, setParams } = useNavigation(); const { navigate, setParams } = useNavigation();
const { const {

View File

@ -16,7 +16,7 @@ import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/h
import SafeArea from '../../components/SafeArea'; import SafeArea from '../../components/SafeArea';
import { satoshiToBTC, satoshiToLocalCurrency } from '../../blue_modules/currency'; import { satoshiToBTC, satoshiToLocalCurrency } from '../../blue_modules/currency';
import * as BlueElectrum from '../../blue_modules/BlueElectrum'; import * as BlueElectrum from '../../blue_modules/BlueElectrum';
import { useBiometrics } from '../../hooks/useBiometrics'; import { unlockWithBiometrics, useBiometrics } from '../../hooks/useBiometrics';
import { TWallet, CreateTransactionTarget } from '../../class/wallets/types'; import { TWallet, CreateTransactionTarget } from '../../class/wallets/types';
import PayjoinTransaction from '../../class/payjoin-transaction'; import PayjoinTransaction from '../../class/payjoin-transaction';
import { NativeStackNavigationProp } from '@react-navigation/native-stack'; import { NativeStackNavigationProp } from '@react-navigation/native-stack';
@ -66,7 +66,7 @@ type ConfirmNavigationProp = NativeStackNavigationProp<SendDetailsStackParamList
const Confirm: React.FC = () => { const Confirm: React.FC = () => {
const { wallets, fetchAndSaveWalletTransactions, counterpartyMetadata, isElectrumDisabled } = useStorage(); const { wallets, fetchAndSaveWalletTransactions, counterpartyMetadata, isElectrumDisabled } = useStorage();
const { isBiometricUseCapableAndEnabled, unlockWithBiometrics } = useBiometrics(); const { isBiometricUseCapableAndEnabled } = useBiometrics();
const navigation = useExtendedNavigation<ConfirmNavigationProp>(); const navigation = useExtendedNavigation<ConfirmNavigationProp>();
const route = useRoute<ConfirmRouteProp>(); // Get the route and its params const route = useRoute<ConfirmRouteProp>(); // Get the route and its params
const { recipients, targets, walletID, fee, memo, tx, satoshiPerByte, psbt, payjoinUrl } = route.params; // Destructure params const { recipients, targets, walletID, fee, memo, tx, satoshiPerByte, psbt, payjoinUrl } = route.params; // Destructure params
@ -148,7 +148,6 @@ const Confirm: React.FC = () => {
satoshiPerByte, satoshiPerByte,
wallet, wallet,
feeSatoshi, feeSatoshi,
unlockWithBiometrics,
], ],
); );

View File

@ -8,7 +8,7 @@ import presentAlert from '../../components/Alert';
import ListItem from '../../components/ListItem'; import ListItem from '../../components/ListItem';
import { useTheme } from '../../components/themes'; import { useTheme } from '../../components/themes';
import prompt from '../../helpers/prompt'; import prompt from '../../helpers/prompt';
import { useBiometrics } from '../../hooks/useBiometrics'; import { unlockWithBiometrics, useBiometrics } from '../../hooks/useBiometrics';
import loc from '../../loc'; import loc from '../../loc';
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation'; import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
import { useStorage } from '../../hooks/context/useStorage'; import { useStorage } from '../../hooks/context/useStorage';
@ -56,7 +56,7 @@ const reducer = (state: State, action: Action): State => {
const EncryptStorage = () => { const EncryptStorage = () => {
const { isStorageEncrypted, encryptStorage, decryptStorage, saveToDisk } = useStorage(); const { isStorageEncrypted, encryptStorage, decryptStorage, saveToDisk } = useStorage();
const { isDeviceBiometricCapable, biometricEnabled, setBiometricUseEnabled, deviceBiometricType, unlockWithBiometrics } = useBiometrics(); const { isDeviceBiometricCapable, biometricEnabled, setBiometricUseEnabled, deviceBiometricType } = useBiometrics();
const [state, dispatch] = useReducer(reducer, initialState); const [state, dispatch] = useReducer(reducer, initialState);
const { navigate, dispatch: navigationDispatch } = useExtendedNavigation(); const { navigate, dispatch: navigationDispatch } = useExtendedNavigation();
const { colors } = useTheme(); const { colors } = useTheme();

View File

@ -44,7 +44,7 @@ import SquareEnumeratedWords, { SquareEnumeratedWordsContentAlign } from '../../
import { useTheme } from '../../components/themes'; import { useTheme } from '../../components/themes';
import prompt from '../../helpers/prompt'; import prompt from '../../helpers/prompt';
import { scanQrHelper } from '../../helpers/scan-qr'; import { scanQrHelper } from '../../helpers/scan-qr';
import { useBiometrics } from '../../hooks/useBiometrics'; import { unlockWithBiometrics, useBiometrics } from '../../hooks/useBiometrics';
import { useExtendedNavigation } from '../../hooks/useExtendedNavigation'; import { useExtendedNavigation } from '../../hooks/useExtendedNavigation';
import usePrivacy from '../../hooks/usePrivacy'; import usePrivacy from '../../hooks/usePrivacy';
import loc from '../../loc'; import loc from '../../loc';
@ -56,7 +56,7 @@ const ViewEditMultisigCosigners: React.FC = () => {
const hasLoaded = useRef(false); const hasLoaded = useRef(false);
const { colors } = useTheme(); const { colors } = useTheme();
const { wallets, setWalletsWithNewOrder, isElectrumDisabled } = useStorage(); const { wallets, setWalletsWithNewOrder, isElectrumDisabled } = useStorage();
const { isBiometricUseCapableAndEnabled, unlockWithBiometrics } = useBiometrics(); const { isBiometricUseCapableAndEnabled } = useBiometrics();
const { isAdvancedModeEnabled } = useSettings(); const { isAdvancedModeEnabled } = useSettings();
const { navigate, dispatch, addListener } = useExtendedNavigation(); const { navigate, dispatch, addListener } = useExtendedNavigation();
const openScannerButtonRef = useRef(); const openScannerButtonRef = useRef();