2021-09-25 17:04:45 +02:00
|
|
|
import { useContext, useEffect } from 'react';
|
2021-01-19 04:44:55 +01:00
|
|
|
import Obscure from 'react-native-obscure';
|
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
|
|
|
Obscure.activateObscure();
|
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
|
|
|
Obscure.deactivateObscure();
|
2021-09-25 17:04:45 +02:00
|
|
|
};
|
|
|
|
return null;
|
|
|
|
};
|
|
|
|
export default Privacy;
|