ADD: Enable/disable Privacy blur on Add Vault screen

This commit is contained in:
Marcos Rodriguez Velez 2024-02-22 18:18:52 -04:00
parent 4f4e8acda6
commit 58e22250e1
No known key found for this signature in database
GPG Key ID: 6030B2F48CCE86D7

View File

@ -1,4 +1,4 @@
import React, { useContext, useRef, useState, useEffect } from 'react';
import React, { useContext, useRef, useState, useEffect, useCallback } from 'react';
import {
ActivityIndicator,
FlatList,
@ -16,7 +16,7 @@ import {
findNodeHandle,
} from 'react-native';
import { Icon } from 'react-native-elements';
import { useNavigation, useRoute } from '@react-navigation/native';
import { useFocusEffect, useNavigation, useRoute } from '@react-navigation/native';
import { getSystemName } from 'react-native-device-info';
import { BlueButtonLink, BlueFormMultiInput, BlueSpacing10, BlueSpacing20, BlueText, BlueTextCentered } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
@ -37,6 +37,7 @@ import { scanQrHelper } from '../../helpers/scan-qr';
import { useTheme } from '../../components/themes';
import Button from '../../components/Button';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/hapticFeedback';
import usePrivacy from '../../hooks/usePrivacy';
const prompt = require('../../helpers/prompt');
const A = require('../../blue_modules/analytics');
@ -66,12 +67,22 @@ const WalletsAddMultisigStep2 = () => {
const [isAdvancedModeEnabledRender, setIsAdvancedModeEnabledRender] = useState(false);
const openScannerButton = useRef();
const data = useRef(new Array(n));
const { enableBlur, disableBlur } = usePrivacy();
useEffect(() => {
isAdvancedModeEnabled().then(setIsAdvancedModeEnabledRender);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
useFocusEffect(
useCallback(() => {
enableBlur();
return () => {
disableBlur();
};
}, [disableBlur, enableBlur]),
);
useEffect(() => {
console.log(currentSharedCosigner);
if (currentSharedCosigner) {