From 9805f145c9242e490dfebd367e3a0ec98f3a8194 Mon Sep 17 00:00:00 2001 From: eudiwtech Date: Mon, 13 Jan 2025 12:02:48 +0100 Subject: [PATCH] fix: remove unwanted changes --- ts/components/LoadingScreenContent.tsx | 14 +------------- .../wallet/screens/pidIssuance/Issuance.tsx | 12 +++--------- ts/screens/Settings.tsx | 2 -- 3 files changed, 4 insertions(+), 24 deletions(-) diff --git a/ts/components/LoadingScreenContent.tsx b/ts/components/LoadingScreenContent.tsx index b13ac1e..ee742c8 100644 --- a/ts/components/LoadingScreenContent.tsx +++ b/ts/components/LoadingScreenContent.tsx @@ -10,7 +10,7 @@ import { WithTestID } from '@pagopa/io-app-design-system'; import * as React from 'react'; -import {AccessibilityInfo, Platform, StyleSheet, View} from 'react-native'; +import {StyleSheet, View} from 'react-native'; import {SafeAreaView} from 'react-native-safe-area-context'; import {LoadingIndicator} from './LoadingIndicator'; @@ -39,18 +39,6 @@ export const LoadingScreenContent = (props: LoadingScreenContentProps) => { const theme = useIOTheme(); const {contentTitle, children, headerVisible, testID} = props; - React.useEffect(() => { - // Since the screen is shown for a very short time, - // we prefer to announce the content to the screen reader, - // instead of focusing the first element. - if (Platform.OS === 'android') { - // We use it only on Android, because on iOS the screen reader - // stops reading the content when the ingress screen is unmounted - // and the focus is moved to another element. - AccessibilityInfo.announceForAccessibility(contentTitle); - } - }, [contentTitle]); - return ( { navigation.navigate('MAIN_TAB_NAV'); }; - const onAdd = (pidToAdd: StoredCredential) => { - dispatch(addCredential({credential: pidToAdd})); - dispatch(setLifecycle({lifecycle: Lifecycle.LIFECYCLE_VALID})); - navigation.navigate('MAIN_WALLET', {screen: 'SUCCESS'}); - }; - const PidPreview = ({credential}: {credential: StoredCredential}) => ( <> @@ -79,7 +72,8 @@ const Issuance = () => { actions={{ primary: { label: t('wallet:pidIssuance.preview.button'), - onPress: () => onAdd(credential), + onPress: () => + dispatch(addCredentialWithIdentification({credential})), icon: 'add', iconPosition: 'end' }, diff --git a/ts/screens/Settings.tsx b/ts/screens/Settings.tsx index 32f102d..24241cf 100644 --- a/ts/screens/Settings.tsx +++ b/ts/screens/Settings.tsx @@ -39,9 +39,7 @@ const Settings = () => { { label: t('settings.listHeaders.test.onboardingReset'), onPress: () => { - dispatch(setLifecycle({lifecycle: Lifecycle.LIFECYCLE_OPERATIONAL})); dispatch(preferencesReset()); - toast.success(t('generics.success')); } } ];