mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 18:00:17 +01:00
23 lines
525 B
JavaScript
23 lines
525 B
JavaScript
import { useContext, useEffect } from 'react';
|
|
import { enabled } from 'react-native-privacy-snapshot';
|
|
import { BlueStorageContext } from './storage-context';
|
|
const Privacy = () => {
|
|
const { isPrivacyBlurEnabled } = useContext(BlueStorageContext);
|
|
|
|
useEffect(() => {
|
|
Privacy.disableBlur();
|
|
}, [isPrivacyBlurEnabled]);
|
|
|
|
Privacy.enableBlur = () => {
|
|
if (!isPrivacyBlurEnabled) return;
|
|
enabled(true);
|
|
};
|
|
|
|
Privacy.disableBlur = () => {
|
|
enabled(false);
|
|
};
|
|
return null;
|
|
};
|
|
|
|
export default Privacy;
|