2021-09-25 17:04:45 +02:00
|
|
|
import { useContext, useEffect } from 'react';
|
2021-01-19 04:44:55 +01:00
|
|
|
import { enabled } from 'react-native-privacy-snapshot';
|
2021-09-25 17:04:45 +02:00
|
|
|
import { BlueStorageContext } from './storage-context';
|
|
|
|
const Privacy = () => {
|
|
|
|
const { isPrivacyBlurEnabled } = useContext(BlueStorageContext);
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
Privacy.disableBlur();
|
|
|
|
}, [isPrivacyBlurEnabled]);
|
|
|
|
|
|
|
|
Privacy.enableBlur = () => {
|
|
|
|
if (!isPrivacyBlurEnabled) return;
|
2021-01-19 04:44:55 +01:00
|
|
|
enabled(true);
|
2021-09-25 17:04:45 +02:00
|
|
|
};
|
2021-01-19 04:44:55 +01:00
|
|
|
|
2021-09-25 17:04:45 +02:00
|
|
|
Privacy.disableBlur = () => {
|
2021-01-19 04:44:55 +01:00
|
|
|
enabled(false);
|
2021-09-25 17:04:45 +02:00
|
|
|
};
|
|
|
|
return null;
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Privacy;
|