Chore: Evaluate SecurityPrivacyView - TypeScript (#4092)

This commit is contained in:
Reinaldo Neto 2022-05-02 23:06:37 -03:00 committed by GitHub
parent 5f1ac0b523
commit 57154101bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -17,22 +17,24 @@ import {
} from '../utils/log'; } from '../utils/log';
import SafeAreaView from '../containers/SafeAreaView'; import SafeAreaView from '../containers/SafeAreaView';
import { ANALYTICS_EVENTS_KEY, CRASH_REPORT_KEY, isFDroidBuild, SWITCH_TRACK_COLOR } from '../lib/constants'; import { ANALYTICS_EVENTS_KEY, CRASH_REPORT_KEY, isFDroidBuild, SWITCH_TRACK_COLOR } from '../lib/constants';
import { SettingsStackParamList } from '../stacks/types';
import { IApplicationState } from '../definitions';
interface ISecurityPrivacyViewProps { interface ISecurityPrivacyViewProps {
navigation: StackNavigationProp<any, 'SecurityPrivacyView'>; navigation: StackNavigationProp<SettingsStackParamList, 'SecurityPrivacyView'>;
} }
const SecurityPrivacyView = ({ navigation }: ISecurityPrivacyViewProps): JSX.Element => { const SecurityPrivacyView = ({ navigation }: ISecurityPrivacyViewProps): JSX.Element => {
const [crashReportState, setCrashReportState] = useState(getReportCrashErrorsValue()); const [crashReportState, setCrashReportState] = useState(getReportCrashErrorsValue());
const [analyticsEventsState, setAnalyticsEventsState] = useState(getReportAnalyticsEventsValue()); const [analyticsEventsState, setAnalyticsEventsState] = useState(getReportAnalyticsEventsValue());
const e2eEnabled = useSelector((state: any) => state.settings.E2E_Enable); const e2eEnabled = useSelector((state: IApplicationState) => state.settings.E2E_Enable);
useEffect(() => { useEffect(() => {
navigation.setOptions({ navigation.setOptions({
title: I18n.t('Security_and_privacy') title: I18n.t('Security_and_privacy')
}); });
}, []); }, [navigation]);
const toggleCrashReport = (value: boolean) => { const toggleCrashReport = (value: boolean) => {
logEvent(events.SP_TOGGLE_CRASH_REPORT); logEvent(events.SP_TOGGLE_CRASH_REPORT);