FIX: Security screen froze on load (#6214)

This commit is contained in:
Marcos Rodriguez Vélez 2024-03-01 18:14:08 -04:00 committed by GitHub
parent 2e24f5173b
commit a6d0073f7e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View file

@ -1,4 +1,4 @@
import React, { useEffect, useState, useCallback, useContext } from 'react';
import React, { useEffect, useState, useContext } from 'react';
import { View, ScrollView, Alert, TouchableOpacity, TouchableWithoutFeedback, Text, StyleSheet, Platform } from 'react-native';
import { useNavigation } from '@react-navigation/native';
import navigationStyle from '../../components/navigationStyle';
@ -28,15 +28,15 @@ const EncryptStorage = () => {
},
});
const initialState = useCallback(async () => {
const initialState = async () => {
const isBiometricsEnabled = await Biometric.isBiometricUseEnabled();
const isDeviceBiometricCapable = await Biometric.isDeviceBiometricCapable();
const biometricsType = (await Biometric.biometricType()) || loc.settings.biometrics;
const isStorageEncryptedSwitchEnabled = await isStorageEncrypted();
setStorageIsEncryptedSwitchEnabled(isStorageEncryptedSwitchEnabled);
setBiometrics({ isBiometricsEnabled, isDeviceBiometricCapable, biometricsType });
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
};
useEffect(() => {
initialState();
// eslint-disable-next-line react-hooks/exhaustive-deps

View file

@ -522,7 +522,9 @@ const ViewEditMultisigCosigners = ({ route }: Props) => {
<BottomModal isVisible={isShareModalVisible} onClose={hideShareModal} doneButton>
<KeyboardAvoidingView enabled={!isPad} behavior={Platform.OS === 'ios' ? 'position' : undefined}>
<View style={[styles.modalContent, stylesHook.modalContent, styles.alignItemsCenter]}>
<Text style={[styles.headerText, stylesHook.textDestination]}>{loc.multisig.this_is_cosigners_xpub} {Platform.OS === "ios" ? loc.multisig.this_is_cosigners_xpub_airdrop : ""}</Text>
<Text style={[styles.headerText, stylesHook.textDestination]}>
{loc.multisig.this_is_cosigners_xpub} {Platform.OS === 'ios' ? loc.multisig.this_is_cosigners_xpub_airdrop : ''}
</Text>
<QRCodeComponent value={exportStringURv2} size={260} isLogoRendered={false} />
<BlueSpacing20 />
<View style={styles.squareButtonWrapper}>