FIX: Disable storage restore feature on macOS

This commit is contained in:
marcosrdz 2020-12-27 18:33:57 -05:00 committed by Overtorment
parent 022579f8b7
commit 008edb12d5
4 changed files with 9 additions and 5 deletions

View File

@ -1,5 +1,7 @@
import { getSystemName } from 'react-native-device-info';
import isCatalyst from 'react-native-is-catalyst';
const isMacCatalina = getSystemName() === 'Mac OS X';
module.exports.isMacCatalina = isMacCatalina;
module.exports.isCatalyst = isCatalyst;

View File

@ -239,7 +239,7 @@
"about_sm_telegram": "Telegram channel",
"about_sm_twitter": "Follow us on Twitter",
"advanced_options": "Advanced Options",
"biom": "biometrics",
"biometrics": "Biometrics",
"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_no_passcode": "Your device does not have a passcode. In order to proceed, please configure a passcode in the Settings app.",

View File

@ -17,6 +17,7 @@ import Biometric from '../../class/biometrics';
import loc from '../../loc';
import { colors } from 'react-native-elements';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { isCatalyst } from '../../blue_modules/environment';
const prompt = require('../../blue_modules/prompt');
const EncryptStorage = () => {
@ -43,7 +44,7 @@ const EncryptStorage = () => {
const initialState = useCallback(async () => {
const isBiometricsEnabled = await Biometric.isBiometricUseEnabled();
const isDeviceBiometricCapable = await Biometric.isDeviceBiometricCapable();
const biometricsType = (await Biometric.biometricType()) || 'biometrics';
const biometricsType = (await Biometric.biometricType()) || loc.settings.biometrics.toLowercase();
const deleteWalletsAfterUninstall = await isDeleteWalletAfterUninstallEnabled();
const isStorageEncryptedSwitchEnabled = await isStorageEncrypted();
setStorageIsEncryptedSwitchEnabled(isStorageEncryptedSwitchEnabled);
@ -156,7 +157,7 @@ const EncryptStorage = () => {
<ScrollView contentContainerStyle={styles.root}>
{biometrics.isDeviceBiometricCapable && (
<>
<BlueHeaderDefaultSubHooks leftText={loc.settings.biom} rightComponent={null} />
<BlueHeaderDefaultSubHooks leftText={loc.settings.biometrics} rightComponent={null} />
<BlueListItem
title={loc.formatString(loc.settings.encrypt_use, { type: biometrics.biometricsType })}
Component={TouchableWithoutFeedback}
@ -176,7 +177,7 @@ const EncryptStorage = () => {
Component={TouchableWithoutFeedback}
switch={{ onValueChange: onEncryptStorageSwitch, value: storageIsEncryptedSwitchEnabled }}
/>
{Platform.OS === 'ios' && (
{Platform.OS === 'ios' && !isCatalyst && (
<BlueListItem
hideChevron
title={loc.settings.encrypt_del_uninstall}

View File

@ -4,6 +4,7 @@ import RNFS from 'react-native-fs';
import RNSecureKeyStore, { ACCESSIBLE } from 'react-native-secure-key-store';
import DefaultPreference from 'react-native-default-preference';
import { Platform } from 'react-native';
import { isCatalyst } from '../../blue_modules/environment';
export default class WalletMigrate {
static expoDataDirectory = RNFS.DocumentDirectoryPath + '/ExponentExperienceData/%40overtorment%2Fbluewallet/RCTAsyncLocalStorage';
@ -14,7 +15,7 @@ export default class WalletMigrate {
// 0: Let's start!
async start() {
if (Platform.OS === 'ios') {
if (Platform.OS === 'ios' && !isCatalyst) {
const defaultPreferenceGroupName = await DefaultPreference.getName();
console.log('----- defaultPreferenceGroupName');
console.log(defaultPreferenceGroupName);